php - Get position of last character in a substring -


$big = "new york city"; $small ="or"; $pos = strpos($big, $small); echo $pos; 

returns 5 want return 6 position of "r". in advance

$big = "new york city"; $small ="or"; $pos = strpos($big, $small); $pos = $pos + strlen($small) - 1;  echo $pos; 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -