Forum Moderators: coopster
$METAR['cityname']='paris';
$METAR['cityid']=12;
then in a constructor i call
$this->setValue('metar',$METAR);
function setValue($field, $value){
$this->values[$field] = $value;
}
i got $this->value['metar']='Array';
it's not an array it's just a word and i can't make it save via real array
Anybody can help me?
[edited by: ergophobe at 11:18 pm (utc) on Feb. 19, 2005]
[edit reason] formatted for readability [/edit]
i got $this->value['metar']='Array';
while
echo($this->value['metar']);will print out
Arrayphp only shows you, that the data can't be written out as a string. if you want to look into that array, use
print_r($this->value['metar']);which will print out any content of any variable and even the structure. then you maybe even see yourself, that using
echo($this->value['metar']['cityname']);will print out
paris.
so really everything is in the right order and you can acces any value in the array, you just have to name the arraykey!