zero-perfoliate
zero-perfoliate

Author Topic: Warning: Invalid argument supplied for foreach() in  (Read 830 times)

Offline anthonyp01

  • New PHP Members
  • Posts: 1
  • Karma: +0/-0
Warning: Invalid argument supplied for foreach() in
« on: May 17, 2008, 08:14:32 AM »
Hello guys! This is my first post and hopefully you can help me!

I am trying to embed my blog into my website and the following code works below on a tempory server but when i run it on my paid server is get this error

Warning: Invalid argument supplied for foreach() in

Can anybody please help me.
Code: [Select]
<?php 
            $rss 
= new lastRSS
            
$rss->cache_dir "_includes/rsscache/"
            
$rss->cache_time 7200;
            
$rssout $rss->get("http://myaccount.blogspot.com/feeds/posts/default?alt=rss");
            foreach(
$rssout['items'] as $item){
                
$time strtotime($item['pubDate']);

                
?>

               
                  <h3><?php echo $item['title'];?></h3>
                    <div>
                    <?php echo html_entity_decode($item['description']);?></div>
                    <h6><?php echo date("jS F Y",$time);?></h6>
               
            <?php 
            
}
            
?>

           
            <?php

Many thanks in advance..


Offline Nick Tompson

  • New PHP Members
  • Posts: 2
  • Karma: +0/-0
Re: Warning: Invalid argument supplied for foreach() in
« Reply #1 on: May 28, 2008, 05:10:40 AM »
Howdy there :)

It is possible $rssout['items'] is not of type Array.
Can you do a print_r() on $rssout['items'] and reply with what it returns?