Q:

PHP JSON Decode versus unserialize

I have the following result from geoPlugin http://www.geoplugin.net/json.gp?ip=64.90.182.55:
geoPlugin({
  "geoplugin_request":"64.90.182.55",
  "geoplugin_status":200,
  "geoplugin_city":"New York",
  "geoplugin_region":"NY",
  "geoplugin_areaCode":212,
  "geoplugin_dmaCode":501,
  "geoplugin_countryCode":"US",
  "geoplugin_countryName":"United States",
  "geoplugin_continentCode":"NA",
  "geoplugin_latitude":40.70890045166,
  "geoplugin_longitude":-74.001197814941,
  "geoplugin_regionCode":"NY",
  "geoplugin_regionName":"New York",
  "geoplugin_currencyCode":"USD",
  "geoplugin_currencySymbol":"&#36;",
  "geoplugin_currencyConverter":1
})

Is there a way to convert this into a PHP array?  I don't want to use the PHP API of geoPlugin as it seems I need to use unserialize, which produces an E_WARNING on my development server (warnings are suppressed on production).  I'd rather not have to deal with E_WARNINGs if I can.  json_decode does not produce an E_WARNING on error, but it won't take the above output as valid. 
Thoughts? 

A:

You can try removing the geoPlugin() surrounding the JSON then PHP's API should work. 
You can remove it with str_replace and substr. 
An example is:
$json = str_replace("geoPlugin(", "", $original_json);
$json = substr($json, 0, -1);
$data = json_decode($json);

