Quantcast
Viewing latest article 2
Browse Latest Browse All 2

json_encode change number into string

I have an array which has some strings values and some numeric values. I used

json_encode

to convert array into json array but it convert numbers values into string which I do not want.

 [["India","2"],["Panama","1"]]

I tried

JSON_NUMERIC_CHECK

as second parameter in json_encode then it works fine on localhost but showing error online.

Use of undefined constant JSON_NUMERIC_CHECK - assumed '

I am using cakephp 2.3


Viewing latest article 2
Browse Latest Browse All 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>