Home > Backend Development > PHP Tutorial > 几行源代码,报错,可小弟我如何也没看出有什么东东

几行源代码,报错,可小弟我如何也没看出有什么东东

WBOY
Release: 2016-06-13 12:14:34
Original
1077 people have browsed it

几行源代码,报错,可我怎么也没看出有什么错误
报错:
( ! ) Deprecated: Function split() is deprecated in D:\wamp\www\my\ereg.php on line 3
Call Stack
# Time Memory Function Location
1 0.0000 140880 {main}( ) ..\ereg.php:0

源代码:

$email = "[email protected]";
$arr = split('@|\.', $email);

while (list($key,$values) = each($arr)) {
echo $values.'
';
}
?>
------解决思路----------------------
Deprecated 中文释义:不推荐使用
split 函数已在废止之列,建议不要使用
------解决思路----------------------
 preg_split() 用它 替代
------解决思路----------------------

$arr = preg_split('/@<br><font color='#FF8000'>------解决思路----------------------</font><br>\./', $email);
Copy after login


引用:
那应该用哪一个函数?

------解决思路----------------------
[email protected] 当然倒过来也一样
然后用explode拆
能避开正则引擎尽量不用
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template