# PHP doesnt like me

**URL:** <https://forum.kirupa.com/t/php-doesnt-like-me/254669>\
**Category:** Uncategorized\
**Created:** [March 14, 2008, 1:28am UTC](https://forum.kirupa.com/t/php-doesnt-like-me/254669 "2008-03-14T01:28:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![theSchtickler](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@theSchtickler](https://forum.kirupa.com/u/theSchtickler)\
**Post date:** [March 14, 2008, 1:28am UTC](https://forum.kirupa.com/t/php-doesnt-like-me/254669/1 "2008-03-14T01:28:14Z")

</div>

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:

```php
$month = 0;

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

```

but this doesnt:

```php
$month = $_GET['mon'];

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

```

Any ideas anyone?
