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

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

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