The following is the response I received using Amazon API PHP
{"ItemsResult":{"Items":[{"ASIN":"B07HGGYWL6","DetailPageURL":"https://www.amazon.in/dp/B07HGGYWL6?tag=nextshop09-21&linkCode=ogi&th=1&psc=1","Images":{"Primary":{"Medium":{"Height":160,"URL":"https://m.media-amazon.com/images/I/41+xWzgV8jL._SL160_.jpg","Width":77}}},"ItemInfo":{"Title":{"DisplayValue":"Samsung Galaxy M31 (Ocean Blue, 6GB RAM, 128GB Storage) - Get Flat Rs 2,500 Instant Discount with select bank cards - Limited Period Offer","Label":"Title","Locale":"en_IN"}},"Offers":{"Listings":[{"Id":"DC6ZAXF6qNdlESLD4vdkiZ4DT0gujZt676%2FhqlbuHpFUc5JDIwpeO0HYeSkcvgeAdXGmWOYc%2FO6DtZxzchM7rvuLPPr5b7Ffmzg2QjBFyU3W24n71nhOwIPUTsI3%2BqTuCfsMSKNtdPoisjWpvceuBxoa%2FFvCQCjX","Price":{"Amount":16499.0,"Currency":"INR","DisplayAmount":"₹ 16,499.00","Savings":{"Amount":1000.0,"Currency":"INR","DisplayAmount":"₹ 1,000.00 (6%)","Percentage":6}},"ViolatesMAP":false}]}}]}}
It is a result of simple echo $response;
How can I echo the "ItemInfo":{"Title"
only ?
The result of $title
should be "Samsung Galaxy M31 (Ocean Blue, 6GB RAM, 128GB Storage) - Get Flat Rs 2,500 Instant Discount with select bank cards - Limited Period Offer".
or the result of $price
should be "16499.0"
I am getting confused with JSON array!