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 - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -