PDA

View Full Version : Make code php5 compatible


w1z4rd
12-11-2006, 03:47 AM
Hi guys The below code was giving me an error. I'm assuming my host recently upgraded from php4 to 5 and the code was not compatible. Can someone help me make this code jive with five? Hope so, thanks alot.

if (VB_AREA == "Forum")
{
global $globaltemplates;

$globaltemplates = array_merge($globaltemplates, array('forumhome_vbshout'));
}

I'm not even sure what if anything makes this code incompatible with 5 but after googling the error for awhile thats my best hunch. I isolated the above code and the error went away but I know it's not "fixed" Anyway thanks again.

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/functions.php(1212) : eval()'d code on line 5

Adrian Schneider
12-11-2006, 03:50 AM
if (VB_AREA == "Forum")
{
global $globaltemplates;

$globaltemplates = array_merge((array)$globaltemplates, array('forumhome_vbshout'));
}

w1z4rd
12-11-2006, 03:53 AM
Lightning fast response. ty sir.