i having json output following. want give incremental id each node , decode. please me.
[{"message":"test+sms","sender":"execut","billcredit":"0.00","messagestatus":"dnd","sendondate":"2015-04-22 15:22:00","provider":"airtel"},{"message":"test+sms","sender":"execut","billcredit":"0.00","messagestatus":"dnd","sendondate":"2015-04-22 15:22:00","provider":"airtel"},{"message":"test+sms","sender":"execut","billcredit":"1.00","messagestatus":"delivrd","sendondate":"2015-04-22 15:22:00","provider":"airtel"},{"message":"test+sms","sender":"execut","billcredit":"1.00","messagestatus":"dnd rejected","sendondate":"2015-04-22 15:22:00","provider":"vodafone"}]
i want output like
id:1 messagestatus:dnd id:2 messagestatus:dnd id:3 messagestatus:deliverd id:4 messagestatus:dnd
$json = '[{"message":"test+sms","sender":"execut","billcredit":"0.00","messagestatus":"dnd","sendondate":"2015-04-22 15:22:00","provider":"airtel"},{"message":"test+sms","sender":"execut","billcredit":"0.00","messagestatus":"dnd","sendondate":"2015-04-22 15:22:00","provider":"airtel"},{"message":"test+sms","sender":"execut","billcredit":"1.00","messagestatus":"delivrd","sendondate":"2015-04-22 15:22:00","provider":"airtel"},{"message":"test+sms","sender":"execut","billcredit":"1.00","messagestatus":"dnd rejected","sendondate":"2015-04-22 15:22:00","provider":"vodafone"}] '; var_dump(json_decode($json));
here ids of each objects. cannot post comment it's long.
Comments
Post a Comment