stilltoni Posted April 27, 2012 Share Posted April 27, 2012 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 Link to comment https://forums.phpfreaks.com/topic/261693-isee-this-error-on-my-website-homepage-warning-implode-functionimplode/ Share on other sites More sharing options...
Zephni Posted April 27, 2012 Share Posted April 27, 2012 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 Link to comment https://forums.phpfreaks.com/topic/261693-isee-this-error-on-my-website-homepage-warning-implode-functionimplode/#findComment-1341046 Share on other sites More sharing options...
noXstyle Posted April 27, 2012 Share Posted April 27, 2012 $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. Link to comment https://forums.phpfreaks.com/topic/261693-isee-this-error-on-my-website-homepage-warning-implode-functionimplode/#findComment-1341052 Share on other sites More sharing options...
Zephni Posted April 27, 2012 Share Posted April 27, 2012 Omg I looked at it wrong and its far too embaressing to explain why I thought that... Link to comment https://forums.phpfreaks.com/topic/261693-isee-this-error-on-my-website-homepage-warning-implode-functionimplode/#findComment-1341112 Share on other sites More sharing options...
Jessica Posted April 27, 2012 Share Posted April 27, 2012 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. Link to comment https://forums.phpfreaks.com/topic/261693-isee-this-error-on-my-website-homepage-warning-implode-functionimplode/#findComment-1341115 Share on other sites More sharing options...
stilltoni Posted April 27, 2012 Author Share Posted April 27, 2012 Thank you noXstyle. now is ok Link to comment https://forums.phpfreaks.com/topic/261693-isee-this-error-on-my-website-homepage-warning-implode-functionimplode/#findComment-1341171 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.