<?php
$string1 = json_decode(123, true);
$string2 = json_decode('123', true);
$string3 = json_decode('{"a": 123}', true);
var_dump($string1, $string2, $string3);
int(123)
int(123)
array(1) {
["a"]=>
int(123)
}
A value can be a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested.
A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. A character is represented as a single character string. A string is very much like a C or Java string.
A number is very much like a C or Java number, except that the octal and hexadecimal formats are not used.
[
"aaa",
"bbb",
"1234"
]