PHP Classes

Error

Recommend this page to a friend!

      PHP Classes blog  >  PHP Tutorial to Detec...  >  All threads  >  Error  >  (Un) Subscribe thread alerts  
Subject:Error
Summary:traditional php script error output
Messages:4
Author:Karl
Date:2016-01-04 13:24:07
Update:2016-01-05 16:09:52
 

  1. Error   Reply   Report abuse  
Picture of Karl Karl - 2016-01-04 19:53:56
PHP Fatal error: Uncaught Error: Cannot use object of type stdClass as array in ip2location.php:14
Stack trace:
#0 {main}
thrown in ip2location.php on line 14

14: echo 'Hello to ', $geoLocation['city_name'];


  2. Re: Error   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2016-01-04 20:41:13 - In reply to message 1 from Karl
I think you need to pass true as second parameter of json_decode.

  3. Re: Error   Reply   Report abuse  
Picture of Alexander Skakunov Alexander Skakunov - 2016-01-04 23:42:55 - In reply to message 2 from Manuel Lemos
Exactly, when second param is TRUE, it's works fine for me.

  4. Re: Error   Reply   Report abuse  
Picture of Karl Karl - 2016-01-05 16:09:52 - In reply to message 3 from Alexander Skakunov
the second param works for me