PHP determines the character function contained in a specified string

time:11-05-22 forum:PHP tools and code
  Reloaded from http://developer.51cto.com/art/200912/166025.htm

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; = {} {} {};}}}}

prev:Two cases built-in card reader, DVD reco... next:
post comment
Notice



approved   The family photo played by their par...   The universal Handbook of life in Ji...   Dr. doctorate: two hands earn money ...   Visiting group of pregnant women wit...   She was 10 years old as a babysitter...
rand   Using iconv to transform UTF-8 Chine...   The strftime () function converts mo...   PHP string intercepting function   The interrotation of time stamp func...   PHP code for different cities from I...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com