Ok we are working with a script and we get the following error

Warning: Invalid argument supplied for foreach() in /xxx/xxx/xxx/spider.php on line 149

Im not sure what the problem is and I havent had any luck fixing it, here is the line in question

foreach ($array as $value) {

We are attaching a copy of the file this is in incase someone needs to see it.

Any help on this is greatly appreciated.

Recommended Answers

All 3 Replies

Don't quote me on this, but I think it's because the array you're passing the foreach loop isn't initialised. I find the following to be interesting in the man page:

foreach works only on arrays, and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable.

I really have no idea what the issue is but I have decided to ditch the script and write my own, but thanks for looking and the help.

No problem. Best of luck with the new script! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.