📜  php json 键值循环 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:38.585000             🧑  作者: Mango

代码示例1
$json = '{"1":"a","2":"b","3":"c","4":"d","5":"e"}';
 $obj = json_decode($json, TRUE);

foreach($obj as $key => $value) 
{
echo 'Your key is: '.$key.' and the value of the key is:'.$value;
}