PHP doesnt like me

Hi there,

So I know what the issue is, but I have no idea how to fix it, or why its a problem…

I’m passing a var thru the URL. The var ‘mon’ comes thru fine, but doesnt seem to work with the foreach command?

This works fine:

$month = 0;

foreach($xmlData->issue[$month]->monthlyStories->article as $article) {
}

but this doesnt:

$month = $_GET['mon'];

foreach($xmlData->issue[$month]->monthlyStories->article as $article) {
}

Any ideas anyone?