object array rewrite in simple mode

for make test, for simulate array I write this:
var array1= new Array("1","2","3","4");

how can I simulate an aray object?
with a var_dump on an array take from a db I havh this:


array(4) { [0]=> object(stdClass)(3)
{ ["id"]=> "28" ....}
[1]=> object(stdClass)(3)
{ ["id"]=> "29" .... }
[2]=> object(stdClass)(3)
{ ["id"]=> "21" ..... }
}

is possible to rewrite manually (I make so but not work)
var array1=new Array( [0]=> object(stdClass)(1) { ["id"]=> "28" ....}
[1]=> object(stdClass)(1) { ["id"]=> "29" .... }
[2]=> object(stdClass)(1) { ["id"]=> "21" ..... }
)
artev [ Sa, 07 Juli 2007 15:57 ] [ ID #1762365 ]

Re: object array rewrite in simple mode

artev wrote:
> is possible to rewrite manually (I make so but not work)
> var array1=new Array( [0]=> object(stdClass)(1) { ["id"]=> "28"
> ....} [1]=> object(stdClass)(1) { ["id"]=>
> "29" .... } [2]=> object(stdClass)(1) {
> ["id"]=> "21" ..... } )
>

$array = array(
(object) array('id' => 1),
(object) array('id' => 2)
);


JW
Janwillem Borleffs [ So, 08 Juli 2007 23:49 ] [ ID #1762861 ]
PHP » alt.php » object array rewrite in simple mode

Vorheriges Thema: CURL
Nächstes Thema: FORTRAN code in a PHP script?