I have this json file that I get from ebay api and I'm trying to echo it. How can I reach specific values such as title, galleryURL, viewItemURL etc.
This is how I tried and getting error
<?php
$json = file_get_contents('ebay api url');
$obj = json_decode($json);
echo $obj-> item[0]->title;
?>
I placed item[0] because usualy I recieve bunch of items inside json And this is json file
{"findItemsIneBayStoresResponse":[{"ack":["Success"],"version":["1.13.0"],"timestamp":["2015-03-03T22:06:11.764Z"],"searchResult":[{"@count":"1","item":[{"itemId":["121579650061"],"title":["McCall's 9119 18\" Doll PatternCarry Case and Accessories Carry Case Doll Trunk "],"globalId":["EBAY-US"],"primaryCategory":[{"categoryId":["38057"],"categoryName":["Dolls, Toys, Animals"]}],"galleryURL":["http://thumbs2.ebaystatic.com/m/mBpbx-hUvsUvTKYMVasM8xA/140.jpg"],"viewItemURL":["http://www.ebay.com/itm/McCalls-9119-18-Doll-PatternCarry-Case-and-Accessories-Carry-Case-Doll-Trunk-/121579650061?pt=LH_DefaultDomain_0"],"paymentMethod":["PayPal"],"autoPay":["false"],"postalCode":["85260"],"location":["Scottsdale,AZ,USA"],"country":["US"],"storeInfo":[{"storeName":["Sew Lovely Patterns"],"storeURL":["http://stores.ebay.com/Sew-Lovely-Patterns"]}],"shippingInfo":[{"shippingServiceCost":[{"@currencyId":"USD","value":"0.0"}],"shippingType":["FlatDomesticCalculatedInternational"],"shipToLocations":["Worldwide"],"expeditedShipping":["false"],"oneDayShippingAvailable":["false"],"handlingTime":["1"]}],"sellingStatus":[{"currentPrice":[{"@currencyId":"USD","value":"21.99"}],"convertedCurrentPrice":[{"@currencyId":"USD","value":"21.99"}],"sellingState":["Active"],"timeLeft":["P22DT22H41M24S"]}],"listingInfo":[{"bestOfferEnabled":["false"],"buyItNowAvailable":["false"],"startTime":["2015-02-24T20:42:35.000Z"],"endTime":["2015-03-26T20:47:35.000Z"],"listingType":["StoreInventory"],"gift":["false"]}],"returnsAccepted":["true"],"galleryPlusPictureURL":["http://galleryplus.ebayimg.com/ws/web/121579650061_1_0_1.jpg"],"condition":[{"conditionId":["1000"],"conditionDisplayName":["New"]}],"isMultiVariationListing":["false"],"topRatedListing":["false"]}]}],"paginationOutput":[{"pageNumber":["1"],"entriesPerPage":["1"],"totalPages":["117"],"totalEntries":["117"]}],"itemSearchURL":["http://stores.ebay.com/Sew-Lovely-Patterns/_i.html?_saslop=1&_fss=1&LH_SpecificSeller=1&_ddo=1&_exmaitems=1&_ipg=1&_mPrRngCbx=1&_os=ST%7CD&_pgn=1&_sid=181133160&_ssn=sewlovelypatterns&_udlo=11"]}]}