Remove the element from specific location php array code example
Example: php remove specific element from array
if (($key = array_search('strawberry', $array)) !== false) {
unset($array[$key]);
}
if (($key = array_search('strawberry', $array)) !== false) {
unset($array[$key]);
}