PHP中的“函数split()已被弃用”?

前端之家收集整理的这篇文章主要介绍了PHP中的“函数split()已被弃用”?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
$stringText = "[TEST-1] test task 1 Created: 06/Apr/11  Updated: 06/Apr/11"; 
$splitArray = split(" ",$stringText);

Deprecated: Function split() is deprecated in C:\wamp\www\RSS.PHP on line 27

为什么这个错误发生?

http://php.net/manual/en/function.split.php

从手册

Warning This function has been
DEPRECATED as of PHP 5.3.0. Relying on
this feature is highly discouraged

Note:

As of PHP 5.3.0,the regex extension
is deprecated in favor of the PCRE
extension. Calling this function will
issue an E_DEPRECATED notice. See the
list of differences for help on
converting to PCRE.

我想你应该使用替代的preg_split().或者如果您不使用正则表达式,只需使用爆炸

原文链接:https://www.f2er.com/php/140038.html

猜你在找的PHP相关文章