-1

我有以下数组输出。例如,我想取消设置索引 16。我取消设置 unset($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
    )

)
4

1 回答 1

2

使用array_search函数获取已知值的键,

$key = array_search('oude prijs',$row[0]);
unset($row[0][$key]);
于 2013-05-27T13:17:41.813 回答