标签:style blog color os sp div log bs 代码
啥也不说 直接上代码:
<?php $email = ‘name@example.com‘; $domain = strstr($email, ‘@‘); echo $domain; // 打印 @example.com echo ‘<br>‘; $user = strstr($email, ‘@‘, true); // 从 PHP 5.3.0 起 echo $user; // 打印 name echo ‘<br>‘; $user = strpos($email, ‘@‘); // 从 PHP 5.3.0 起 echo $user; // 打印 name ?>
看结果:
@example.com
name
4
标签:style blog color os sp div log bs 代码
原文地址:http://www.cnblogs.com/yhl664123701/p/4146733.html