Ich habe ein PHP-Array, das ungefähr so aussieht:
Index Key Value
[0] 1 Awaiting for Confirmation
[1] 2 Assigned
[2] 3 In Progress
[3] 4 Completed
[4] 5 Mark As Spam
Wenn ich die Array-Werte var_dump bekomme, bekomme ich Folgendes:
array(5) { [0]=> array(2) { ["key"]=> string(1) "1" ["value"]=> string(25) "Awaiting for Confirmation" } [1]=> array(2) { ["key"]=> string(1) "2" ["value"]=> string(9) "Assigned" } [2]=> array(2) { ["key"]=> string(1) "3" ["value"]=> string(11) "In Progress" } [3]=> array(2) { ["key"]=> string(1) "4" ["value"]=> string(9) "Completed" } [4]=> array(2) { ["key"]=> string(1) "5" ["value"]=> string(12) "Mark As Spam" } }
Ich wollte Completed entfernen und als Spam markieren . Ich weiß, dass ich es kann unset[$array[3],$array[4]), aber das Problem ist, dass die Indexnummer manchmal unterschiedlich sein kann.
Gibt es eine Möglichkeit, sie zu entfernen, indem der Wertname anstelle des Schlüsselwerts abgeglichen wird?