开发者

php stdClass Object

开发者 https://www.devze.com 2023-03-08 05:23 出处:网络
I\'m a bit lost. with print_r I get these results stdClass Object ( [distlat] => 0 [distlng] => 0 [id] => 380 )

I'm a bit lost.

with print_r I get these results

stdClass Object ( [distlat] => 0 [distlng] => 0 [id] => 380 ) 

but how can echo the results?

like stdClass->distlat->$distlat ?

please give me a开发者_如何学JAVA hint.


So,

echo $object->distlat;
echo $object->distlng;

doesn't work for you?


You are using print_r on a variable I guess, such $myVariable

To access the data of your object use :

echo $myVariable->distlat;
echo $myVariable->distlng;
echo $myVariable->id;

And try using var_dump instead of print_r. Information is a little completer with var_dump. (You have type information with it).

0

精彩评论

暂无评论...
验证码 换一张
取 消