Thread: wierd output
View Single Post
Old 01-18-2003, 11:24 AM   #6 (permalink)
Ilya020
Techno Rat
 
Ilya020's Avatar
 
Join Date: Jan 2003
Location: San Diego
Posts: 559
Ilya020 is on a distinguished road
Send a message via AIM to Ilya020
Quote:
Originally posted by DesertWolf
Well to start with your array structure is wrong and when you echo output you are getting "array" because you are not calling out the elements of the array.
Try this:

<?php
$crew = array(
"Name" =>"Ilya",
"age"=>13,
"location"=>"San Diego, Ca"
);
for ($n=0;$n<count($crew); $n++) {
$Line = each ($crew);
print ("$Line[key] : $Line[value].<P.\n");
}
?>

I'm not sure if that is perfect I haven't messed with PHP very much, but if you plan on printing out more that one persons info you should look at using an array for names, ages and locations.
BTW, you dont need quotes around Name and Age and location, you only need quotes for two or more words...


Ilya
__________________
> SELECT * FROM users WHERE clue > 0
0 rows returned
Ilya020 is offline   Reply With Quote