Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php remove object from array by property

$new_array = [];
foreach ($myarray as $key => $value) {
    if ($value->catid == 29) {
        $new_array[] = $value;
        unset($myarray[$key]);        
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #remove #object #array #property
ADD COMMENT
Topic
Name
1+6 =