<?php
//header('Content-Type: application/json');
include 'include/db.php';
 $number=array();
for($i=1;$i<=12;$i++)
{
    if(strlen($i)<2)
    {
      $month='0'.$i;
    }
    else
    {
      $month=$i;
    }
    $year=$_REQUEST['year'];
    $xyz=$year.'-'.$month;
    $query="select count(created_date) as number from registration where created_date like '%$xyz%' order by created_date desc";
    $connection=mysqli_query($conn,$query);
    $no=mysqli_num_rows($connection);
    if($no>0)
    {
        while($rows=mysqli_fetch_array($connection))
        {
          // $number[$mnth[$i-1]]=$rows['number'];    //  create associative array
           $number[]=$rows['number'];
        }
    }
}
echo json_encode($number);
?>