Using loop I want to get the following paramatersid,device_id from the given code
$str = '{"response":{"success":true,"result":{"success":[{"id":"31281985","device_id":"26965","message":"BIG WINTER CLOSING SALE! Starting from FRIDAY 30th Dec 2016. Discount upto 55%OFF on all Ladies, Gents & Kids Shoes. at All Branches of ENGLISH SHOES MULTAN. ","status":"pending","send_at":1485859669,"queued_at":0,"sent_at":0,"delivered_at":0,"expires_at":1485863269,"canceled_at":0,"failed_at":0,"received_at":0,"error":"","created_at":1485859669,"contact":{"id":"6317522","name":"923456812536","number":"923456812536"}},{"id":"31281984","device_id":"26965","message":"BIG WINTER CLOSING SALE! Starting from FRIDAY 30th Dec 2016. Discount upto 55%OFF on all Ladies, Gents & Kids Shoes. at All Branches of ENGLISH SHOES MULTAN. ","status":"pending","send_at":1485859669,"queued_at":0,"sent_at":0,"delivered_at":0,"expires_at":1485863269,"canceled_at":0,"failed_at":0,"received_at":0,"error":"","created_at":1485859669,"contact":{"id":"6317521","name":"923336088811","number":"923336088811"}}],"fails":[]}},"status":200}'
please Guide how to proceed . it seems its nested json response