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
how to assign a variable string from an array? [message #172451] Fri, 18 February 2011 19:54 Go to previous message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma:
Senior Member
$a=array(1=>
array("John","123 Adams","555-0102","electrician"),
array("Bob","234 Quincy","555-7788","barber"),
array("Charles","756 Capitol","555-9090","teacher")
)

<a href="#">John</a>
<a href="#">Bob</a>
<a href="#">Charles</a>

Given that a popup box will appear showing each of the individuals
information from the array, how does one go about doing that?
echo $a[1][1]
would print out that item only in all three cases.
I need it to be like
echo $a[x][1]
Where x can be either of the item indexes.

I have looked at dozens of sites that talk about arrays, but none that I
have seen show how to do this. One site briefly mentioned the extract()
function but was rather lame on an explanation.
[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: Fri Nov 22 23:59:09 GMT 2024

Total time taken to generate the page: 0.05241 seconds