php - how to filter object with foreach -
i delete informations in object key.
is possible likes that:
foreach ( $object $key => $value ) { if ( $key == "abc" ) { unset( $object{ $key } ); } }
when try have:
cannot use object of type stdclass array
thx
foreach ($object $key => $value) { if ($key === "abc") { unset($object->key); } }
although seeing know key (based on "if") this:
unset($object->abc);
Comments
Post a Comment