z3r0
06-22-2019, 08:32 AM
I've got a couple of PHP warnings showing up in my error logs, can any of you guys advise me of a fix?
Error
PHP Warning: explode() expects parameter 2 to be string, array given in w:\xxxxx\xxxxx\file.php on line 328
PHP Warning: array_merge(): Argument #1 is not an array in w:\xxxxx\xxxxx\file.php on line 329
Lines 328 & 329
$tomerge = explode(",", str_replace(" ","",$templates));
$cacheadd = array_merge($tomerge, $cacheadd);
If it helps this is the full condition that the code is contained in.
if ($templates)
{
$tomerge = array ();
$tomerge = explode(",", str_replace(" ","",$templates));
$cacheadd = array_merge($tomerge, $cacheadd);
}
Error
PHP Warning: explode() expects parameter 2 to be string, array given in w:\xxxxx\xxxxx\file.php on line 328
PHP Warning: array_merge(): Argument #1 is not an array in w:\xxxxx\xxxxx\file.php on line 329
Lines 328 & 329
$tomerge = explode(",", str_replace(" ","",$templates));
$cacheadd = array_merge($tomerge, $cacheadd);
If it helps this is the full condition that the code is contained in.
if ($templates)
{
$tomerge = array ();
$tomerge = explode(",", str_replace(" ","",$templates));
$cacheadd = array_merge($tomerge, $cacheadd);
}