我收到此错误: function split() deprecated
list ($kk, $vv) = split( ' ', $buf, 2);
Run Code Online (Sandbox Code Playgroud)
当我将其替换为explode或preg_split 出现此错误时 Undefined offset: 1 E_NOTICE Error in file
list ($kk, $vv) = explode( " ", $buf, 2);
Run Code Online (Sandbox Code Playgroud)
这是完整的代码
function get_toprotatingbanners()
{
$s = array ();
$file = fopen ('inc/adsadmin/toprotatingbanners.php', 'r');
if ($file)
{
while ($buf = fgets ($file, 20000))
{
$buf = chop ($buf);
if (($buf != '<?/*' AND $buf != '*/?>'))
{
list ($kk, $vv) = explode(" ", $buf, 2);
$s[$kk] = …Run Code Online (Sandbox Code Playgroud)