PDA

View Full Version : PHP error help


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);
}

romaine
06-26-2019, 10:35 PM
Are you using vB 4.2.5?

If you make any changes on vB cores then can make other functions not work, for these commands, trying to find same php functions that work with PHP 7.