Answers for "remove item from atrray in js"

0

remove item from array

$input = array("item 2", "item 4");
$key = array_search('item 2', $input);
if($key!==false){
    unset($input[$key]);
}
var_dump($input);
Posted by: Guest on April-24-2021
0

remove item from array

$input = array("item 2", "item 4");
$key = array_search('item 2', $input);
if($key!==false){
    unset($input[$key]);
}
var_dump($input);
Posted by: Guest on April-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language