gpt4 book ai didi

php - PHP 中的 "Function split() is deprecated"?

转载 作者:IT王子 更新时间:2023-10-29 00:07:09 26 4
gpt4 key购买 nike

$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()。或者,如果您不使用正则表达式,只需使用 explode

关于php - PHP 中的 "Function split() is deprecated"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5699137/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com