php strpos() function
Translation results:
英[strɪŋ] 美[strɪŋ]
n.String; rope, belt; thread, plant fiber; [Computer Science] String
vt. Winding, tuning; To line up in a line or a series; to tie, tie or hang with a thread; to extend or extend
Third person singular: strings Plural: strings Present participle: stringing Past tense: strung Past participle: strung
php strpos() functionsyntax
Function: Find the position where a certain character first appears in a string
Syntax: strpos(string,find,start)
Parameters:
Description | |
Required. Specifies the string to search for. | |
Required. Specifies the string to search for. | |
Optional. Specifies where to start the search. |
Description: Find the first occurrence of a string in another string. The strpos() function is case-sensitive. This function is binary safe.
php strpos() functionexample
<?php echo strpos("You love php, I love php too!","php"); ?>
Run instance»
Click the "Run instance" button to view the online instance
Output:
9
<?php var_dump(strpos("You love php, I love php too!","PHP")) ; ?>
Run Instance»
Click the "Run Instance" button to view the online instance
Output:
bool(false)