0
每次我傳遞數組數據時,它會在每次傳遞新選擇時覆蓋自身。我希望它能夠添加到之前的選擇並保持增長。PHP數組覆蓋自己
即時通訊我的頭試圖解決這個問題,是由於數組傳遞沒有足夠的尺寸或正確的鍵?
echo '<input type="checkbox" id ="menu" name="'.$did.'['.$result2['cid'].']'.'['.$result2['id'].']" value="'.$result2['id'].'">'.ucwords($result2['name']).'<br />';
if($array){
foreach ($array as $key => $value){
if(is_array($value)){
foreach ($value as $key => $value){
$query = mysql_query("SELECT title FROM menuCategory WHERE cid = $key");
$result = mysql_result($query,0);
echo '<h1>'.ucwords($result).'</h1>';
foreach ($value as $key => $value){
echo '<input type="hidden" name="'.$key.'" value ="'.$value.'">';
$query = mysql_query("SELECT cid, id, name FROM menuBread WHERE id = $value");
$result = mysql_fetch_assoc($query);
echo ucwords($name = $result['name']).'<br />';
}
}
}
}
}