Jump to content

Isee this error on my website homepage : Warning: implode() [function.implode]..


stilltoni

Recommended Posts

I get this error on my homepage  :

Warning: implode() [function.implode]: Invalid arguments passed in /home/shqip1/peqini.com/wp-content/themes/sportpress/functions/wpzoom-widgets.php on line 1469

 

This is the code to modify

 

http://pastebin.com/RiBsyG3c

 

 

 

Thanks

Your code:

$postsq = implode(",",$category);

 

Looks like you have passed too many parameters.

The function returns a string with glued array items like: array("bob","gary") would return "bob-gary" if you used implode("-", array("bob","gary"))

 

Try this documentation: http://php.net/manual/en/function.implode.php

$postsq = implode(",",$category);

Looks like you have passed too many parameters.

The function returns a string with glued array items like: array("bob","gary") would return "bob-gary" if you used implode("-", array("bob","gary"))

 

What do you mean by 'passed too many parameters' ? He is passing a comma as the glue and $category as the array. Unfortunately the $cateagory is not an array at this instance.

 

You probably want to check that the $category actually holds an array:

elseif ($type == 'cat')
{
    if(isset($category) && is_array($category))
        $postsq = implode(",",$category);
}

 

And if this breaks functionality, you should debug the code and see where the $category actually comes from and why it is not an array.

 

Omg I looked at it wrong and its far too embaressing to explain why I thought that...

It's quite obvious, you saw " and thought it was two '. It's not really embarrassing.

 

noXstyle is correct on the problem.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.