我想以复杂的格式打印索引,但是我没有成功。
$forExample = '{"sik1":"hello","sik2":"world","sik10":"today","sik41":"yesterday"}';
$test = json_decode($forExample);
shuffle($test);
foreach ($test as $key => $value){
echo $key, ' => ', $value;
echo '<br>';
}
结果:
sik1 => hello
sik2 => world
sik10 => today
sik41 => yesterday
错误在哪里?