0
    $result = mysql_query($sql_result);
    $newArray = array();
    $index=0;
    while($row = mysql_fetch_assoc($result)){
        $newArray[$index] = $row;   
        $index++;
    }

I wanna ignore the value - from my assoc array when display. Help me please.enter image description here

4

1 回答 1

1

如果要删除包含某个值的所有列,可以使用 array_filter:

function removeEmpty($v){
   return $v != '-';
}
while($row = mysql_fetch_assoc($result)){
        $newArray[$index] = array_filter($row,"removeEmpty");   
        $index++;
}
于 2013-04-18T08:48:04.907 回答