Home >Backend Development >PHP Tutorial >array获取值。
var_dump($str);
// array(4) { ["race"]=> int(11) ["season"]=> int(4) ["motor"]=> int(1) ["street"]=> int(1) }
怎么foreach后获取
race
season
motor
street
foreach(array_keys($str) as $k) echo $k.'
';