variable as array...get the data inside one
Posted: Fri Dec 20, 2002 4:54 pm
I have this code in a file:
So i know that i can call the variable $var like this:
but i need to know if its possible to call it by position.. for example varName1 = 0
varName2 = 1
varName3 = 2
bu t i have trie to do this and doesnt work $string = $var[0]
and the variable string doesnt take anything....
Any of you could help me please??
Thanks
Code: Select all
$var = array (
'varName1' => "Hello Wolrd 1",
'varName2' => "Hello Wolrd 2",
'varName3' => "Hello Wolrd 3"
)Code: Select all
$string = $varї'varName1']varName2 = 1
varName3 = 2
bu t i have trie to do this and doesnt work $string = $var[0]
and the variable string doesnt take anything....
Any of you could help me please??
Thanks