Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How php converts json data into strings
How php converts json data into strings
Json data itself is a string.

If we say conversion, we only mean the conversion between php array and json string. Here we will introduce you to two functions of php operating json.

json_decode()? Encoding a string in JSON format?

Explain?

mixed json_decode ( string $json [,bool $assoc ])?

Accept JSON format strings and convert them into PHP variables?

Parameters?

json?

A string in json string format to decode. ?

assoc?

When this parameter is TRUE, an array is returned instead of an object. ?

Return value?

Returns an object, or an associative array if the optional assoc parameter is TRUE. ?

JSON _ encode-JSON encoding variable?

Report a bug description?

string json_encode ( mixed $value [,int $options = 0 ])?

JSON form of return value value?

Report a bug parameter?

Value?

The value to be encoded can be any data type except the resource type.

This function can only accept UTF-8 encoded data?