how to display object property?

how to display object property?

am 21.12.2007 13:48:03 von jcoder

hello,

i have an object but i dont know what are the property field and
values. what to do in php in order to see the properties. to make
myself more clear, to view object property in javascript i do it this
way:

var str;
for(var x in _obj){
str+=' //'+x+' ';
}
alert(str);

thank you.

Re: how to display object property?

am 21.12.2007 14:02:51 von ivansanchez-alg

jcoder wrote:

> i have an object but i dont know what are the property field and
> values. what to do in php in order to see the properties.

http://php.net/print_r
http://php.net/var_dump


Geez.

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Saber llorar es la sabiduría de la sencillez.- M. de Unamuno.

Re: how to display object property?

am 21.12.2007 14:06:19 von luiheidsgoeroe

On Fri, 21 Dec 2007 13:48:03 +0100, jcoder
wrote:

> hello,
>
> i have an object but i dont know what are the property field and
> values. what to do in php in order to see the properties.

print_r()/var_dump()/Reflection
--
Rik Wasmus

Re: how to display object property?

am 21.12.2007 15:19:12 von gordon

On Dec 21, 12:48 pm, jcoder wrote:
> hello,
>
> i have an object but i dont know what are the property field and
> values. what to do in php in order to see the properties. to make
> myself more clear, to view object property in javascript i do it this
> way:
>
> var str;
> for(var x in _obj){
> str+=' //'+x+' ';}
>
> alert(str);
>
> thank you.

http://www.php.net/print_r/

RTFM

Re: how to display object property?

am 21.12.2007 16:31:27 von puzz

jcoder wrote:
> hello,
>
> i have an object but i dont know what are the property field and
> values. what to do in php in order to see the properties. to make
> myself more clear, to view object property in javascript i do it this
> way:

There is also get_object_vars() :

class A { var $a = 1; var $b = "jlkjkl"; }
$a = new A();
$properties = get_object_vars( $a );
foreach( $properties as $k => $v ) {
print "$k -> $v
";
}

--
www.panoye.com :: virtual tour