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
Post a Comment