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

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -