RE: [PHP] Newbie: Array of objects iteration
| From: | MEM | Date: | Sat, 10 Oct 2009 09:49:23 +0000 |
| Subject: | RE: [PHP] Newbie: Array of objects iteration | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-298828@lists.php.net to get a copy of this message | ||
>
> MEM,
>
> http://www.php.net/language.oop5.reflection
>
>
> Regards,
> Tommy
>
>
And brand new world opens in from of my eyes... O.O.
I will search more info on this on the net... just for the records, as
properties names is concern, I couldn't find any better I suppose:
http://pt.php.net/manual/en/reflectionproperty.getname.php
I'm just wondering, we call it like this?
$property = new ReflectionProperty($myproperty);
$proptertyName = $property->getName();
Can we called statically like this?
$propertyName = ReflectionProperty::getName($myproperty); -> this would
be nice. :)
The documentation is a little bit lacking, and I'm a little bit newbie, is
this correct?
Note:
The array_keys as a possibility to retrieve ALL keys from a given array. It
would be nice to retrieve ALL properties names at once as well...
:)
Regards,
Márcio