Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to delete all properties of an object in php

//this is my code

if you want to add Properties to an object but also delete or remove,
all the previous Properties of the object, then we do this:-
  
<?php
  $obj = (array)null;
        $obj['attributes'] = '1234';
        $obj['attributes'] = 'hello';
        $obj = (object)$obj;
  var_dump($obj);
?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #properties #object #php
ADD COMMENT
Topic
Name
4+2 =