我有这个数组:
$array = array(
"foo" => "bar",
"barw" => "21",
"bara" => "22",
"barq" => "25",
"multix" => array(
"1" => array(
"ar1" => "food",
"ar2" => "dr",
"ar3" => "ch",
"ar4" => "ju"
),
"2" => array(
"ar1" => "food",
"ar2" => "dr",
"ar3" => "ch",
"ar4" => "ju"
),
"893" => "bar",
"563" => "bar",
"hd8" => "bar",
"multiv" => array(
"1" => array(
"ar1" => "food",
"ar2" => "dr",
"ar3" => "ch",
"ar4" => "ju"
),
"2" => array(
"ar1" => "food",
"ar2" => "dr",
"ar3" => "ch",
"ar4" => "ju"
),
"tw" => "bar",
"qa" => "bar",
"op" => "bar"
)
)
);
我正在阅读和写作这样的内容:
echo '<pre>';
print_r($array);
echo '</pre>';
echo "<br/>";
echo $array['multix']['1']['ar1'].'<br/>';
echo "<br/>";
echo $array['multix']['1']['ar2'].'<br/>';
echo "<br/>";
echo $array['multix']['1']['ar3'].'<br/>';
echo "<br/>";
echo $array['multix']['1']['ar4'].'<br/>';
$array['multix']['1']['ar4'] = "lego";
但是,我无法删除我选择的数组,例如:
unset($array['multiv']['1']);
echo '<pre>';
print_r($array);
echo '</pre>';
我应该怎么做才能使用它的键删除数组?