Re: (array)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jay Paulson wrote:
Just came across some code I haven't seen before and can't find anything on
php.net or google about it (maybe I'm not searching for the right thing?).
What is the following doing?

// $dataobject is holding a bunch of variables like:
//      $dataobject->var1
//      $dataobject->var2
//      etc...

(array)$dataobject;

Is this making the $dataobject an associative array like:

$dataobject["var1"]
$dataobject["var2"]

Or is it doing something different?


Yes, I believe it's type-casting the object into an array. Do a print_r ( $dataobject ) on it before and after the casting.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel@xxxxxxxxxxxxxxxxxxxxxxxxxxx

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux