title: Check if an item isset in a decoded JSON string
body: <p>I'm working on a module which loads data from Twitter's user_timeline REST API.  Once I have the JSON decoded, I do a foreach statement in my PHP to get each of the returned tweets.  I'm currently having an issue checking for items under the retweeted_status portion of the JSON string.  The JSON I'm calling is:</p>
  
  <pre><code>"http://api.twitter.com/1/statuses/user_timeline.json?count=".$count."&amp;include_rts=1&amp;screen_name=".$uname.""
  </code></pre>
  
  <p>retweeted_status is only returned if a tweet is a retweet.  So, for example, if the tweet is a retweet, I want to return the original tweet's text, not the retweet.  I've tried this code:</p>
  
  <pre><code>if(isset($t-&gt;retweeted_status-&gt;text)) {
      $tweet = $t-&gt;retweeted_status-&gt;text;
  } else {
      $tweet = $t-&gt;text;
  }
  </code></pre>
  
  <p>Using the above code, when retweeted_status is NOT returned, isset is still true for all objects after the first time the isset is returned true.</p>
  
  <p>What I need is a conditional within my foreach that will properly check for items under retweeted_status (since the retweeted datapoint is disabled and has been for some time) and reset the check to false if retweeted_status is not present.</p>
  
  <p>Any suggestions?</p>