英[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 stristr() function syntax

Function: Returns the string from the beginning to the end of a string in another string, case-insensitive

Syntax: stristr(string ,search,before_search

Parameters:

##ParameterDescriptionstringRequired. Specifies the string to be searched. search Required. Specifies the string to be searched. If the parameter is a number, search for characters matching the ASCII value corresponding to the number. before_search Optional. The default value is a Boolean value of "false". If set to "true", it will return the part of the string before the first occurrence of the search parameter.

Note: The search string is in another The first occurrence in a string. This function is binary safe. This function is not case-sensitive. For case-sensitive searches, use the strstr() function.

php stristr() function example

<?php
echo stristr("Hello php.cn!","php");
?>

Run instance»

Click the "Run instance" button to view the online instance

Output:

php.cn!
<?php
echo stristr("i study php in php.cn!","study");
?>

Run Instance»

Click the "Run Instance" button to view the online instance

Output:

study php in php.cn!