note 89466 added to class.arrayobject

From: Date: Mon, 09 Mar 2009 19:04:11 +0000
Subject: note 89466 added to class.arrayobject
Groups: php.notes 
Request: Send a blank email to php-notes+get-151659@lists.php.net to get a copy of this message
To get a primitive array type back from an ArrayObject you can use the member function exchangeArray() or more simply just cast it: <?php $object = new ArrayObject(); $object[] = "Hello World!"; // $object is now an ArrayObject with one value appended. $array = (array) $object; // $array is now a simple array with the single value "Hello World!". ?> ---- Server IP: 92.48.74.199 Probable Submitter: 89.145.198.195 ---- Manual Page -- http://www.php.net/manual/en/class.arrayobject.php Edit -- https://master.php.net/note/edit/89466 Del: integrated -- https://master.php.net/note/delete/89466/integrated Del: useless -- https://master.php.net/note/delete/89466/useless Del: bad code -- https://master.php.net/note/delete/89466/bad+code Del: spam -- https://master.php.net/note/delete/89466/spam Del: non-english -- https://master.php.net/note/delete/89466/non-english Del: in docs -- https://master.php.net/note/delete/89466/in+docs Del: other reasons-- https://master.php.net/note/delete/89466 Reject -- https://master.php.net/note/reject/89466 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#151659) next »