RE: [PHP] using extract inside an object
| From: | phpsurf | Date: | Fri, 21 Jun 2002 13:39:31 +0000 |
| Subject: | RE: [PHP] using extract inside an object | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-103271@lists.php.net to get a copy of this message | ||
great !
I should have thought about that ! :)
and any idea of how to cast into a specific class instead of stdClass ?
> -----Original Message-----
> From: Remy Dufour [mailto:rdufour@propage.com]
> Sent: vendredi 21 juin 2002 15:21
> To: phpsurf; php-general@lists.php.net
> Subject: 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
> > )
> > that I would like to transform into the following object
> > stdClass Object
> > (
> > [one] => 1
> > [two] => 2
> > )
> >
> > any idea ?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif