如何获取二维 PHP 数组的 ID?
Array
(
[4] => Test
[6] => This is a test
[9] => 19
[15] => Bla Bla Bla
[appid] => 19746
)
这就是我从字符串创建数组的方式:
$str = '4=Test&6=This is a test&9=19&15=Bla Bla Bla&appid=19746';
$result = array();
parse_str($str, $result);
print_r($result);
foreach ($result as $part) {
print_r("id: $id\n"); // I need to get the ID here
print_r("part: $part \n");
}