wp_json_encode


wp_json_encode ( $data, $options = 0, $depth = 512 )

Parameters:
  • (mixed) $data Variable (usually an array or object) to encode as JSON.
  • (int) $options Optional. Options to be passed to json_encode(). Default 0.
  • (int) $depth Optional. Maximum depth to walk through $data. Must be greater than 0. Default 512.
Returns:
  • (string|false) The JSON encoded string, or false if it cannot be encoded.
Defined at:

Description

Encode a variable into JSON, with some sanity checks.

Related Functions

wp_is_json_request, wp_send_json_error, _wp_json_sanity_check, wp_encode_emoji, _wp_iso_convert

Top Google Results

User discussions

wpseek mobile