Extract substring from string using php -


i need extract substring string using php.

$string = 'this string conteined code:xyz123'; $code = substr($text, -1, strpos($string,'code:')); echo $code ; // return 3 

i need whole code example xyz123

try code :

$string = 'this string conteined code:xyz123'; $code = substr($string ,strpos($string,'code:')); echo $code; 

make sure helpful you.


Comments

Popular posts from this blog

c - zlib and gdi32 with OpenSSL? -

java - inputmismatch exception -

ios - Align baselines with characters in large line heights with Text Kit -