title: Why Would Json_decode() return NULL? (parsing ebay api in php)
body: <p>A curious problem here and I'm sure the answer is staring me right in the face but I cannot see it.<br>
  I have called some data from Ebays api and I have recieved a json file in response.<br>
  To help me debug an potential errors, I use var_dump() to see what the data looks like before and after it has been decoded but in this case when i use var_dump() after i have used json_decode() it comes up NULL.</p>
  
  <p>I have used this code for two other sites and I cannot see why this is has crept in. Here is the code I am using:</p>
  
  <pre><code>$url = "http://svcs.ebay.co.uk/services/search/FindingService/v1?SECURITY-APPNAME=(App Id)&amp;OPERATION-NAME=findItemsByKeywords&amp;SERVICE-VERSION=1.0.0&amp;RESPONSE-DATA-FORMAT=JSON&amp;callback=_cb_findItemsByKeywords&amp;GLOBAL-ID=EBAY-GB&amp;REST-PAYLOAD&amp;keywords=Iphone&amp;paginationInput.entriesPerPage=2";
  $headers = array( "Content-type: application/json;charset=\"utf-8\"",  "Accept: text/xml", "Cache-Control: no-cache", "Pragma: no-cache", "SOAPAction: \"run\"");
  $cURL = curl_init();
  
  curl_setopt($cURL, CURLOPT_URL, $url);
  curl_setopt($cURL, CURLOPT_HTTPGET, true);
  curl_setopt($cURL, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
  
  $result = curl_exec($cURL);
  
  $json=json_decode($result, true);
  
  echo"&lt;br&gt;result in json &lt;br&gt;";
  var_dump($result);
  
  echo "&lt;br&gt;&lt;br&gt; Json Decoded &lt;br&gt;";
  var_dump($json);
  curl_close($cURL);
  </code></pre>
  
  <p>the result is:</p>
  
  <pre><code>result in json
  string(3166) "/**/_cb_findItemsByKeywords({"findItemsByKeywordsResponse":[{"ack":["Success"],"version":["1.13.0"],"timestamp":["2015-07-19T22:17:01.579Z"],"searchResult":[{"@count":"2","item":[{"itemId":["131555668833"],"title":["Apple iPhone 4 - 16GB - Black (Orange) Smartphone"],"globalId":["EBAY-GB"],"primaryCategory":[{"categoryId":["9355"],"categoryName":["Mobile &amp; Smart Phones"]}],"galleryURL":["http:\/\/thumbs2.ebaystatic.com\/m\/m4DvclaIDHqh3yoWm-57LQg\/140.jpg"],"viewItemURL":["http:\/\/www.ebay.co.uk\/itm\/Apple-iPhone-4-16GB-Black-Orange-Smartphone-\/131555668833?pt=LH_DefaultDomain_3"],"productId":[{"@type":"ReferenceID","__value__":"102596407"}],"paymentMethod":["PayPal"],"autoPay":["false"],"postalCode":["BR27JR"],"location":["Bromley,United Kingdom"],"country":["GB"],"shippingInfo":[{"shippingServiceCost":[{"@currencyId":"GBP","__value__":"8.0"}],"shippingType":["FlatDomesticCalculatedInternational"],"shipToLocations":["US","CA","GB","AU","AT","BE","FR","DE","IT","JP","ES","NL","BG","HR","CY","CZ","DK","FI","GR","HU","IE","LT","LU","MT","PL","PT","RO","SK","SI","SE","RU","NZ","IL","NO"]}],"sellingStatus":[{"currentPrice":[{"@currencyId":"GBP","__value__":"50.0"}],"convertedCurrentPrice":[{"@currencyId":"GBP","__value__":"50.0"}],"bidCount":["0"],"sellingState":["Active"],"timeLeft":["P0DT0H3M17S"]}],"listingInfo":[{"bestOfferEnabled":["false"],"buyItNowAvailable":["false"],"startTime":["2015-07-12T22:20:18.000Z"],"endTime":["2015-07-19T22:20:18.000Z"],"listingType":["Auction"],"gift":["false"]}],"condition":[{"conditionId":["3000"],"conditionDisplayName":["Used"]}],"isMultiVariationListing":["false"],"topRatedListing":["false"]},{"itemId":["311405341211"],"title":["Apple Iphone 6 16GB Gold EE Network UK. Faulty Faulty."],"globalId":["EBAY-GB"],"primaryCategory":[{"categoryId":["9355"],"categoryName":["Mobile &amp; Smart Phones"]}],"galleryURL":["http:\/\/thumbs4.ebaystatic.com\/m\/m0vIGIioZxGpyu1J_KTJ2bw\/140.jpg"],"viewItemURL":["http:\/\/www.ebay.co.uk\/itm\/Apple-Iphone-6-16GB-Gold-EE-Network-UK-Faulty-Faulty-\/311405341211?pt=LH_DefaultDomain_3"],"paymentMethod":["PayPal"],"autoPay":["false"],"postalCode":["UB25UW"],"location":["Southall,United Kingdom"],"country":["GB"],"shippingInfo":[{"shippingServiceCost":[{"@currencyId":"GBP","__value__":"8.75"}],"shippingType":["FlatDomesticCalculatedInternational"],"shipToLocations":["GB","NO"]}],"sellingStatus":[{"currentPrice":[{"@currencyId":"GBP","__value__":"270.0"}],"convertedCurrentPrice":[{"@currencyId":"GBP","__value__":"270.0"}],"bidCount":["24"],"sellingState":["Active"],"timeLeft":["P0DT0H6M4S"]}],"listingInfo":[{"bestOfferEnabled":["false"],"buyItNowAvailable":["false"],"startTime":["2015-07-18T22:23:05.000Z"],"endTime":["2015-07-19T22:23:05.000Z"],"listingType":["Auction"],"gift":["false"]}],"condition":[{"conditionId":["7000"],"conditionDisplayName":["For parts or not working"]}],"isMultiVariationListing":["false"],"topRatedListing":["false"]}]}],"paginationOutput":[{"pageNumber":["1"],"entriesPerPage":["2"],"totalPages":["1183420"],"totalEntries":["2366839"]}],"itemSearchURL":["http:\/\/www.ebay.co.uk\/sch\/i.html?_nkw=Iphone&amp;_ddo=1&amp;_ipg=2&amp;_pgn=1"]}]})"
  
  Json Decoded
  NULL 
  </code></pre>
  
  <p>Any ideas where i have gone wrong with this?</p>