Does JSON 'officially' Support Conversion of Native Types?
问题 In PHP, you can use json_encode to encode an object as a json string. $string = json_encode($some_object); However, PHP has the standard slew of datatypes which are not considered objects (ints, strings, etc.) If you pass in a string to json_encode , this returns a string that contains a javascript statement that could be used to define the string. In less awkward phrasing, this echo json_encode("Hello world, please don't " . '"' . "misuse quote's for emphasis " . "or possessive apostrophes'