I\'m getting below JSON response:
[{\"startDate\":\"2012-07-12 11:21:38 +0530\",\"totalTime\":0},{\"startDate\":\"2012-07-11 11:27:33 +0530\",\"totalTime\":0
As everyone said, and you did - use json_decode
.
$dateArrays = json_decode($dateTimeArr, true); // decode JSON to associative array
foreach($dateArrays as $dateArr){
echo $dateArr['startDate'];
echo $dateArr['totalTime'];
}
In future, if you are unsure what type or structure of data is in the variable, do var_dump($var)
and it will print type of variable and its content.