How to convert no of days array into json format <p>I have created an array of no of days using the <strong>for loop</strong> </p> <pre><code>$noOfDays=array(); for($i=1;$i&lt;=31;$i++){ if ($i == '1') { $noOfDays[$i]['Number']=$i; $noOfDays[$i]['Days']=$i.' Day'; }else{ $noOfDays[$i]['Number']=$i; $noOfDays[$i]['Days']=$i.' Days'; } } </code></pre> <p>and than converted this array into json </p> <pre><code>echo $noOfDaysjson= json_encode($noOfDays); </code></pre> <p>the $noOfDaysjson returns json as below :-</p> <pre><code>{**"1"**:{"Number":1,"Days":"1 Day"},**"2"**:{"Number":2,"Days":"2 Days"},**"3"**:{"Number":3,"Days":"3 Days"},**"4"**:{"Number":4,"Days":"4 Days"},"5":{"Number":5,"Days":"5 Days"},"6":{"Number":6,"Days":"6 Days"},"7":{"Number":7,"Days":"7 Days"},"8":{"Number":8,"Days":"8 Days"},"9":{"Number":9,"Days":"9 Days"},"10":{"Number":10,"Days":"10 Days"},"11":{"Number":11,"Days":"11 Days"},"12":{"Number":12,"Days":"12 Days"},"13":{"Number":13,"Days":"13 Days"},"14":{"Number":14,"Days":"14 Days"},"15":{"Number":15,"Days":"15 Days"},"16":{"Number":16,"Days":"16 Days"},"17":{"Number":17,"Days":"17 Days"},"18":{"Number":18,"Days":"18 Days"},"19":{"Number":19,"Days":"19 Days"},"20":{"Number":20,"Days":"20 Days"},"21":{"Number":21,"Days":"21 Days"},"22":{"Number":22,"Days":"22 Days"},"23":{"Number":23,"Days":"23 Days"},"24":{"Number":24,"Days":"24 Days"},"25":{"Number":25,"Days":"25 Days"},"26":{"Number":26,"Days":"26 Days"},"27":{"Number":27,"Days":"27 Days"},"28":{"Number":28,"Days":"28 Days"},"29":{"Number":29,"Days":"29 Days"},"30":{"Number":30,"Days":"30 Days"},"31":{"Number":31,"Days":"31 Days"}} </code></pre> <p>but i donot want the no. shown like 1, 2 in bold in json format</p> <p>how can i get json like:-</p> <pre><code>'[{"Number":"1","Days":"1 Day"},{"Number":"2","Days":"2 Days"},{"Number":"3","Days":"3 Days"},{"Number":"4","Days":"4 Days"},....so on]'; </code></pre>