Re: [PHP] using extract inside an object
>
>
> Try this
> $a = array('one'=>1, 'two'=>2 );
> $b = (object)$a;
>
> > I have the following array:
> > Array
> > (
> > [one] => 1
> > [two] => 2
> > )
>
Try this
$a = array('one'=>1, 'two'=>2 );
$b = (object)$a;
> I have the following array:
> Array
> (
> [one] => 1
> [two] => 2
> )
> that I would like to transform into the following object
> stdClass Object
> (
> [one] => 1
> [two] => 2
> )
>
> any idea ?
--
PHP General Maili
Hi
does anyone know how to use the function extract inside an object, so as the
created variables become attributes of the object ?
a little example to be more explicit :)
I have the following array:
Array
(
[one] => 1
[two] => 2
)
that I would like to transform into the following obje
3 matches
Mail list logo