我想从stdclass读取值并将它们显示为字符串。 var_dump产生这个:
object(stdClass)#886 (7) {
["Address"]=>
object(stdClass)#885 (8) {
["AddressLine"]=>
string(0) “”
["AdminDistrict"]=>
string(5) “Wales”
["CountryRegion"]=>
string(14) “United Kingdom”
["District"]=>
string(0) “”
["FormattedAddress"]=>
string(43) “Llangefni, Isle of Anglesey, United Kingdom”
["Locality"]=>
string(9) “Llangefni”
["PostalCode"]=>
string(0) “”
["PostalTown"]=>
string(0) “”
}
["BestView"]=>
object(stdClass)#839 (2) {
["Northeast"]=>
object(stdClass)#881 (3) {
["Altitude"]=>
float(0)
["Latitude"]=>
float(53.261619567871)
["Longitude"]=>
float(-4.3000702857971)
}
如何获得"纬度"并将其显示为字符串? 谢谢!
答案 0 :(得分:0)
做
$yourObj->BestView->Northeast->Latitude