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
Code:
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
Code:
$tomerge = explode(",", str_replace(" ","",$templates));
$cacheadd = array_merge($tomerge, $cacheadd);
If it helps this is the full condition that the code is contained in.
Code:
if ($templates)
{
$tomerge = array ();
$tomerge = explode(",", str_replace(" ","",$templates));
$cacheadd = array_merge($tomerge, $cacheadd);
}