PHP Hapus elemen tertentu dari array
if (($key = array_search('strawberry', $array)) !== false) {
unset($array[$key]);
}
Matteoweb
if (($key = array_search('strawberry', $array)) !== false) {
unset($array[$key]);
}
$array=array_diff($array,['strawberry']);
if (($key = array_search('strawberry', $array)) !== false) {
unset($array[$key]);
}