JSON uses JavaScript syntax, learn more
JSON Tutorial[
^]
this
{"Rec": [{"SlNo":1,"Name": " ","DOB": " "}]}
represents a json array called "Rec" that contains one object element with these property-value pairs {"SlNo":1,"Name": " ","DOB": " "}.
One of the two ways to get the values of these property is through the object way. Learn
PHP: Classes and Objects - Manual[
^]
<?php
$json = '{"Rec": [{"SlNo":1,"Name": " ","DOB": " "}]}';
$object = json_decode($json);
$Rec = $object->Rec;
$element = $Rec[0];
echo $element->SlNo;
?>
Any way is to through the associative array using
json_decode($json, true)
I will leave it to you to explore this option. Learn
PHP 5 Arrays[
^]