Oplyning fra array uden brugerinput
Hvordan trække man oplysningen ud af sidste linie (echo "Antal frugter ialt:",count($a);) fra et andet php dokument?<?
$a = array(
"æble" => array(
"color" => "rød",
"taste" => "sød",
"shape" => "rund"
),
"appelsin" => array(
"color" => "orange",
"taste" => "sød",
"shape" => "rund"
),
"banan" => array(
"color" => "gul",
"taste" => "melet",
"shape" => "halvmåne"
)
);
echo $a["$frugt"]["taste"];
echo $a["$frugt"]["color"];
echo $a["$frugt"]["shape"];
echo "Antal frugter ialt:",count($a);
?>
-Remiz
