FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » how to assign a variable string from an array?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: how to assign a variable string from an array? [message #172452 is a reply to message #172451] Fri, 18 February 2011 20:04 Go to previous messageGo to previous message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma:
Senior Member
On 18-02-11 20:54, richard wrote:
> $a=array(1=>
> array("John","123 Adams","555-0102","electrician"),
> array("Bob","234 Quincy","555-7788","barber"),
> array("Charles","756 Capitol","555-9090","teacher")
> )

// John,Bob, Charles
echo "Names: \n<br>";
for ($x=1; $x<count($a[1]); $x++ ) {
echo $a[$x][0]."\n<br>";
}

// Adresses
echo "Addresses: \n<br>";
for ($x=1; $x<count($a[1]); $x++ ) {
echo $a[$x][1]."\n<br>";
}


--
Luuk
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: simple modal box to display info
Next Topic: Adult only
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 21:01:33 GMT 2024

Total time taken to generate the page: 0.03568 seconds