Answers for "php remove property from object"

PHP
5

delete property from object php

unset($a->new_property);
Posted by: Guest on March-15-2020
0

php remove object from array by property

$new_array = [];
foreach ($myarray as $key => $value) {
    if ($value->catid == 29) {
        $new_array[] = $value;
        unset($myarray[$key]);        
    }
}
Posted by: Guest on May-20-2021
0

remove field from object php

unset($a->new_property);
Posted by: Guest on December-03-2020

Code answers related to "php remove property from object"

Browse Popular Code Answers by Language