2013-05-27 122 views
-1

我有以下數組輸出。例如,我想取消設置索引16. 我沒有設置未設置($ row [0] [16]);未設置元素陣列鍵未知

但是現在我不知道索引16.我怎麼能通過ifelse「oude prijs」取消它?

Array 
(
[0] => Array 
    (
     [0] => productname 
     [1] => price 
     [2] => description 
     [3] => producturl 
     [4] => imageurl 
     [5] => weight 
     [6] => category 
     [7] => merk 
     [8] => ontwerper 
     [9] => afmetingen 
     [10] => levertijd 
     [11] => garantie 
     [12] => secondarycategories 
     [13] => laagsteprijsgarantie 
     [14] => verzendkosten 
     [15] => productcode 
     [16] => oude prijs 
     [17] => ID 
     [18] => status 
    ) 

) 

回答

2

使用array_search函數來獲取已知值的關鍵,

$key = array_search('oude prijs',$row[0]); 
unset($row[0][$key]);