에서 결과를 해독하려고하는 것은 여기에 내 코드 (CURL)
입니다 : 내가 빈 화면이 수신이 코드JSON/컬은 GET 요청
<?php
$url = "http://www.sportsdirect.com/DesktopModules/ProductDetail/API/ItemSuggestions/GetProductSuggestions?productId=433006&numPlacements=1&ItemType=product";
// Initiate curl
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIE, "ChosenSite=www; SportsDirect_AnonymousUserCurrency=GBP; language=en-GB");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
curl_setopt($ch, CURLOPT_VERBOSE, true);
// Execute
$result=curl_exec($ch);
// Closing
curl_close($ch);
// Will dump a beauty json :3
$collections = json_decode($result);
foreach ($collections as $item) {
$Title = $item->Products->Title;
echo $Title;
}
, 어떤 결과가 인쇄되지 않습니다. 내가 원하는 건 echo
모든 제품의 모든 Title
이름입니다.
내 실수는 어디에서 어떻게 할 수 있습니까?