Current Location: Home> Function Categories> stripos

stripos

Find the location where the string first appears (case insensitive)
Name:stripos
Category:String
Programming Language:php
One-line Description:Returns where the string first appears in another string (case insensitive).

Definition and usage

stripos() function finds where the string first appears in another string (case insensitive).

Note: The stripos() function is case-insensitive.

Note: This function is binary safe.

Related functions:

  • strpos() - Find where the string first appears in another string (case sensitive)
  • strripos() - Find the last occurrence of a string in another string (case insensitive)
  • strrpos() - Find the last occurrence of a string in another string (case sensitive)

Example

Find the first occurrence of "php" in a string:

 <?php
echo stripos ( "You love php, I love php too!" , "PHP" ) ;
?>

Try it yourself

grammar

 stripos ( string , find , start )
parameter describe
string Required. Specifies the string to search.
Find Required. Specifies the characters to be searched.
start Optional. Specify the location to start the search.