The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

$jokes should contain an array. The error indicates it doesn't. To be sure, you'd have to post the entire code here (let's hope it's not too long ). Do use the appropriate php tags around the code please.

Have to excuse my complete ignorance here (completely new to php) but where would I place that please?

var_dump dumps the contents of a variable so you can view it, your error is that the argument in the for loop (the variable $jokes) is incorrect, so it is helpful to see what is in that variable. Put it before the for()

string(60) "Why did the chicken cross the road? To get to the other side" Warning: Invalid argument supplied for foreach() in G:\mowes_portable\www\db\jokes.html.php on line 15

Which I presume is showing the array information - which is correct = the joketext

foreach requires an array, the clue as to what is wrong above is "string(60)", a string is not an array, you can read more about types in php here, but essentially:

PHP Code:

$jokes = new array(); // create an empty array named jokes$jokes[0] = 'why did the chicken ...'; // add this string to the array$jokes[1] = 'I just flew in from ...'; // add another string, jokes is now an array containing two strings