php remove specific element from array

45

if (($key = array_search('strawberry', $array)) !== false) {
    unset($array[$key]);
}
if (($key = array_search('strawberry', $array)) !== false) {
    unset($array[$key]);
}

Comments

Submit
0 Comments