PHP100 2019-03-27
代码如下:
<?php /*如手册上的举例*/ $email = '[email protected]'; $domain = strstr($email, '@'); echo $domain; // prints @example.com ?>
代码如下:
$str= 'abc'; $needle= 'a'; $pos = strpos($str, $needle);
代码如下:
function checkstr($str){ $needle = "a";//判断是否包含a这个字符 $tmparray = explode($needle,$str); if(count($tmparray)>1){ return true; } else{ return false; } }