How to check with Json or Curl when a page looks empty?
<p>I have a function that loops some data with JSON.</p>

<p>The problem is that weh nmy foreach loop finds this situation here <code>https://graph.facebook.com/search?q=berlusca&amp;limit=10&amp;type=post&amp;until=1327422514</code> it stops working...</p>

<p>How can I check when the page has empty data??</p>

<p>This is my foreach:</p>

<pre><code>function getPostInfo($url, $lang, $stopwords) {
$j = json_decode(startCurl($url));
foreach($j-&gt;data as $v) {
if ($v-&gt;type == 'status') {
        $post['author_id'][] = $v-&gt;from-&gt;id;
        $post['original_id'][] = $v-&gt;id;
        $ret['post_url'][] = getPostUrl($original_id, $author_id);
        //$description = stopWords($v-&gt;message);
        $post['description'][] = $v-&gt;message;
        $post['pub_date'][] = $v-&gt;created_time;
    }
}   
 return $post;
}
</code></pre>
