One of my webs service is responding value in octal(010), I want to use this value as key in an array.
$key = 010;
$a[$key] = 'test';
print_r($a);
Result :
Array
(
[8] => test
)
Expected :
Array
(
[010] => test
)
PHP is converting 010 value to 9 even I do typecasting, I tried (string) $key
and sprintf('%s', $key)
but no luck.
Is there anyway do we have to convert octal to string without change the value?