Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php conditionally remove element from array

foreach ($array as $key => $element) {
    if ($element['age'] > 90) {
        unset($array[$key]);
    }
}
 
PREVIOUS NEXT
Tagged: #php #conditionally #remove #element #array
ADD COMMENT
Topic
Name
9+6 =