以下では:
<?php
$test = array(
array("fName" => "Paul", "lName" => "Jones", "Age" => "31"),
array("fName" => "Mike", "lName" => "Hunt", "Age" => "3"),
array("fName" => "John", "lName" => "Doe", "Age" => "32")
);
?>
<pre> <?php var_dump($test) ?> </pre>
<?php
foreach($test[0] as $key => $value) {
echo $value . " " ;
}
?>
これは出力しますPaul Jones 31
最初の名前だけを出力するにはどうすればよいfNames
ですか?
すなわちPaul, Mike, John