Finds the last occurrence of a case-insensitive string inside a string.

Arguments Edit

void strripos ({{{params}}})

Argument Inclusion Edit

  • strripos needs PHP version 5 to work.

Return values Edit

strripos will return the numeric position of the last case-insensitive search string inside the given string. Note that the position in string starts with 0 and not with 1. If the optional offset parameter was set it starts searching at the character with that number. The return value will still be relative to the beginning of the string.

Examples Edit

Example 1: The direct way Edit

 echo strripos("Find a string inside a StrING", "string");

Output2 Edit

Example 2: Using a variable and offset Edit

 $string = "abc cde fgh ijkl m n";
 $find   = "fgh";
 echo strripos($string, $find, 2); // Stars searching at the first b

Output Edit

For more details on this function, visit its entry in the php manual.