array获取值。

WBOY
WBOYOriginal
2016-06-23 14:11:39836browse

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.'
';

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn