PHP determines the character function contained in a specified string
1. strstr: returns a string from the judged character to the end, and if no return value is not included, it does not contain
code as follows:
[code]
.lt;? PHP / * such as the example * / $email ='user@example.com'on the manual; Str ($email, '@'); echo $domain; / / prints @example.com?.gt; [/code]
2. stristr: it is exactly the same as strstr. The two function is fast, and the strpos has a parameter to specify the location, but the default is empty. It means to judge the whole string. The disadvantage is that the support for Chinese is not good. The code for the
PHP judgment string contains the following code as follows:
[code]$str='abc'; $needle='a'; $POS = strpos ($str The code that uses explode to judge the
PHP judgment string is as follows:
[code]function checkstr ($str) {$needle =.Quot; a.quot; / / / / / / / / / judgement; = {} {} {};}}}}