Re: Convert an array in an object instance
| From: | M. Sokolewicz | Date: | Mon, 25 Oct 2004 12:39:36 +0000 |
| Subject: | Re: Convert an array in an object instance | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-200238@lists.php.net to get a copy of this message | ||
Francisco M. Marzoa Alonso wrote:
Hi, Is it possible to convert an array in an object instance? I can convert an object in an array as follows: $Test = new MyClass (); $TestArray = (array) $Test; Then I've an array with all members of the object $Test, but it seems that I cannot simply do: $TestObject = (MyClass) $TestArray; $TestObject = (object) $TestArray;
To recover the object in the inverse way, so... is there any manner to do this? Thanks a lot in advance,