You are using var_dump all wrong...Just use plain assignment(or Output buffering which is unnecessary in this case).
Okay. Try some debugging.
First, make sure that the cURL function is returning data. Place this code below $geoloc = json_decode(curl_exec($ch), true);
Then post the results here.
And make use of PHP /PHP tags and put your PHP code between them - there's even a button that does that....its mighty hard to read code like plaintext.