{"Data":{"Date":"08:09 20-01-2014","SchoolID":"923214157777","Type":"1","Nic":{"3520135201001","3520135201002","3520135201003"}}}

Recommended Answers

It's Date, not date

Jump to Post

All 3 Replies

$json = '{"Data":{"Date":"08:09 20-01-2014","SchoolID":"923214157777","Type":"1","Nic":["3520135201001","3520135201002","3520135201003"]}}';
$main_array=json_decode($json);
foreach($main_array->Data as $obj ) {
echo $obj->date;

i am using this approach but its keep on giving me a warning
how to get the nic array in it ?

It's Date, not date

commented: well that's very nice of you but i just typed here wrong :) +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.