JsonEncode
class JsonEncode implements EncoderInterface
Encodes JSON data.
Methods
| __construct($bitmask) | ||
| int | getLastError() deprecated Returns the last encoding error (if any). | |
| scalar | encode(mixed $data, string $format, array $context = array()) Encodes PHP data to a JSON string. | |
| bool | supportsEncoding(string $format) Checks whether the serializer can encode to given format. |
Details
__construct($bitmask)
Parameters
| $bitmask |
int getLastError() deprecated
deprecated
Returns the last encoding error (if any).
Return Value
| int |
See also
| http://php.net/manual/en/function.json-last-error.php | json_last_error |
scalar encode(mixed $data, string $format, array $context = array())
Encodes PHP data to a JSON string.
{@inheritdoc}
Parameters
| mixed | $data | Data to encode |
| string | $format | Format name |
| array | $context | options that normalizers/encoders have access to |
Return Value
| scalar |
bool supportsEncoding(string $format)
Checks whether the serializer can encode to given format.
Parameters
| string | $format | format name |
Return Value
| bool |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/Serializer/Encoder/JsonEncode.html