3
When I use echo var_dump($location);
I get this:
object(stdClass)#1226 (2) { ["type"]=> string(5) "Point" ["coordinates"]=> array(2) { [0]=> float(44.0928438) [1]=> float(-70.20876942) } }
I tried to obtain the numbers floats((44.0928438, -70.20876942)), with the following code:
$lat = $location["type"]["coordinates"][0];
$long = $location["type"]["coordinates"][1];
But when I run my php file, it gives me the following error not because:
Fatal error: Cannot use Object of type stdClass as array in /Applications/XAMPP/xamppfiles/htdocs/aw014/Externalwebserviceadapter/Adapters/Twitteradapter.class.php on line 62
In addition to the more elaborate responses, a var_dump() followed by a echo is not only wrong but unnecessary, since var_dump() already sends output to the browser. ^_^
– Bruno Augusto
I think the var_dump was just to show the content of the object as a form of debugging, should not be to display given to the browser...
– Wakim
Put the
$location
in your code ! if you could see? Because I wonder if a class has to use->
!!! but first I need to see$location
– user6026
@Wakim, yes, yes, but am I cranky, do what? p
– Bruno Augusto
@Brunoaugusto, understood, no problem hehe
– Wakim