I am getting JSON from PHP and using it in JavaScript to put Select Box option value. But when i am putting my PHP side JSON in JavaScript it is sorting automatically.
This should not be done.
Actually i am using this JSON as HTML select Box option value and i need my original data as coming From PHP side.
JSON Coming from PHP side:
PHP CODE:
$optionJSON= json_encode($optionValues);
Result:
{
"0":"Select",
"37":"Abc",
"47":"DEF",
"359":"GHI",
"182":"JKL",
"360":"MNO",
"183":"PQR",
"320":"STU",
"38":"VWX",
"80":"YZA"
}
Showing In browser console and same order in Select Box Option value.
{
"0": "Select",
"37": "Abc",
"38": "VWX",
"47": "DEF",
"80": "YZA",
"182": "JKL",
"183": "PQR",
"320": "STU",
"359": "GHI",
"360": "MNO"
}