I received this error: function split() deprecated
list ($kk, $vv) = split( ' ', $buf, 2);
When I replaced it with explode or preg_split I got this error Undefined offset: 1 E_NOTICE Error in file
list ($kk, $vv) = explode( " ", $buf, 2);
This is the full code
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] = $vv;
continue;
}
}
}
fclose ($file);
return $s;
}
Please help me.
Function split is deprecated "This function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0." as you can see on php.net/manual/en/function.split.php
Undefined offset: 1 is because $buf is undeffined.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With