-1
我有一个登录表单,用户必须在其中输入他的电子邮件地址。 现在我想切断@
和电子邮件域,并将其另存为用户名。PHP字符串切片
例如:
$email = $_POST['email'];
//$email = [email protected]
现在的用户名应该是:
muser.hans
我有一个登录表单,用户必须在其中输入他的电子邮件地址。 现在我想切断@
和电子邮件域,并将其另存为用户名。PHP字符串切片
例如:
$email = $_POST['email'];
//$email = [email protected]
现在的用户名应该是:
muser.hans
随着[SUBSTR](http://www.php.net/ manual/en/function.substr.php)和[strpos](http://www.php.net/manual/en/function.strpos.php)。 – machineaddict