little question to arrays...

Alles, was PHP betrifft, kann hier besprochen werden.

little question to arrays...

Postby estudiante » 20. May 2009 11:09

Why isn´t this working? ::

Code: Select all
<?php
 $my_array = array (0 => array ("foto" => "cero_foto",
                   "name" => "cero_name"));
 var_dump ($my_array);
 print "$my_array[0]["foto"]";  // this is not the way to do this...
?>


Thanks a lot.
estudiante
 
Posts: 15
Joined: 04. May 2009 10:08

Re: little question to arrays...

Postby Wiedmann » 20. May 2009 11:11

Please provide a full description, including the current and expected result.

(and also use the code tags)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: little question to arrays...

Postby tienod » 26. May 2009 00:22

change the line:
print "$my_array[0]["foto"]";
to:
print $my_array[0]['foto'];

this should work
tienod
 
Posts: 4
Joined: 22. February 2009 04:14


Return to PHP

Who is online

Users browsing this forum: No registered users and 15 guests