Welcome Guest, Not a member yet? Register   Sign In
Why can't I limit this Array
#1

[eluser]RaZoR LeGaCy[/eluser]
I am having problems limiting this array. I tried array_slice and it didn't work.

Code:
$channel = Array ( [items] => Array ( [0] => Array ( [title] => 'Horror frog' breaks own bones to produce claws [link] => http://digg.com/general_sciences/Horror_frog_breaks_own_bones_to_produce_claws_3 [description] => Actively breaks its own bones to produce claws that puncture their way out of the frog's toe pads, probably when it is threatened. [pubDate] => Thu, 29 May 2008 10:57:24 +0000 ) [1] => Array ( [title] => The 7 Most Annoying People On Digg [link] => http://digg.com/comedy/The_7_Most_Annoying_People_On_Digg [description] => Despite being arguably the most mainstream site of its kind, digg.com still is not free of the countless horrors that spawn in the seedy underbelly of the net. Today, we take you on a virtual safari to show you some of the worst species in the digg community. [pubDate] => Fri, 23 May 2008 00:53:50 +0000 ) )

I want to limit that and my current code is
Code:
if(is_array($channel)) {
    foreach ($channel as $item) {
    
        foreach ($item as $row) {
        
            echo $row['title'] ."<br />\n";
        }
    }
}
else {
    break;
}

Thanks everyone.


Messages In This Thread
Why can't I limit this Array - by El Forum - 06-05-2008, 06:41 PM
Why can't I limit this Array - by El Forum - 06-05-2008, 07:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB