Jump to content

separate this array()


dreamwest

Recommended Posts

What is the best way to seperate this array?

 

["funny games","64,700,000 results","0"],
["funny jokes","20,200,000 results","1"],
["funny quotes","29,200,000 results","2"],
["funny pictures","141,000,000 results","3"],
["funny facebook status","20,100,000 results","4"],
["funny videos","72,000,000 results","5"],
["funny sayings","3,210,000 results","6"],
["funny exam answers","100,000,000 results","7"],
["funny names","99,400,000 results","8"],
["funny","262,000,000 results","9"]

 

Link to comment
Share on other sites

Here's one way:

<?php
$ary = array(
array("funny games","64,700,000 results","0"),
array("funny jokes","20,200,000 results","1"),
array("funny quotes","29,200,000 results","2"),
array("funny pictures","141,000,000 results","3"),
array("funny facebook status","20,100,000 results","4"),
array("funny videos","72,000,000 results","5"),
array("funny sayings","3,210,000 results","6"),
array("funny exam answers","100,000,000 results","7"),
array("funny names","99,400,000 results","8"),
array("funny","262,000,000 results","9")
);
foreach ($ary as $next) {
   echo $next[0] . "<br>\n";
}
?>

 

Ken

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.