I count article view by timestamp month using json output. I have this code :
$value = array();
$stats = Access::FETCH("SELECT COUNT(*) AS id FROM news_stats GROUP BY YEAR(date), MONTH(date)");
foreach($stats as $key => $value){
$rows2[] = $value['id'];
}
echo json_encode($rows2);
output is : NOTE: this is count for month each month
["1","6"]
I need to print month name for this ouput like this:
["january","June"]
How do can in print month name ? Menaig is: 1 , 6 count from which month?