February 9th, 2010


Warning: Invalid argument supplied for foreach()

by Dragos, on October 16th, 2008  

Warning: Invalid argument supplied for foreach()
If you get this error it means that the “array” you’ve passed to the foreach loop is actually not an array. To check if a variable is an array use the is_array($var) function. But if your variable turns out to be an array, it means then that it is [...]

Warning: array_filter() [function.array-filter]: The first argument should be an array

by Dragos, on October 16th, 2008  

Warning: array_filter() [function.array-filter]: The first argument should be an array
Even if my variable $kwds was an array, and the function is_array returned true i don’t know why it still threw a warning. To overpass it, instead of $kwds=array_filter($kwds); i wrote $kwds=array_filter(array($kwds)); Now it works I Hope it will help somebody.