「php入門」foreachで連想配列のキーと値を取得する
phpコード
<?php
$city = array(
'CityA’ => 'tokyo’,
'CityB’ => 'oosaka’,
'CityC’ => 'fukuoka’,
);
foreach ($city as $key => $value){
echo $key;
echo $value;
}
?>
Coding Changes the World
phpコード
<?php
$city = array(
'CityA’ => 'tokyo’,
'CityB’ => 'oosaka’,
'CityC’ => 'fukuoka’,
);
foreach ($city as $key => $value){
echo $key;
echo $value;
}
?>