object reflection in php?
| From: | Filippo Veneri | Date: | Mon, 18 Mar 2002 11:28:00 +0000 |
| Subject: | object reflection in php? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-88912@lists.php.net to get a copy of this message | ||
Is there a way to get the name of a filed
from a variable pointing to some object?
Just to make myself understood:
class obj {
var $field;
function obj( $value ) {
$this->field = $value;} } $o = new obj( "field value" ); How can i know, if possible, that the instance of obj pointed to by $o has a field named "field"? This would be useful to write an object to a database without knowing its structure 'a-priori'. Thanks fbv