I have this data
$s = '{ "date": "2015-07-30","value": 66568 },{ "date": "2015-07-29","value": 66598 },{ "date": "2015-07-28","value": 66680 },{ "date": "2015-07-27","value": 66774 }';
Im graphing the data and basically i need the graph to show the earliest date first, this can be accomplished if i simply flip the data. I tried using:
implode(' ', array_reverse(explode(',', $s)))
and that didnt work.
The data comes from the db and is appended to
if($test!=1) {
$testString = $testString.',{ "date": "'.date("Y-m-d",strtotime($date)).'","value": '.$res[$row]['followed_by'].' }';
} else {
$testString = $testString.'{ "date": "'.date("Y-m-d",strtotime($date)).'","value": '.$res[$row]['followed_by'].' }';
}
The data is added to the graph with "dataProvider": [ <?php echo $testString; ?> ]