I have an api where I return json. json_encode on arrays are returning null. In what cases does json_encode return null? Also what other values does json_encode return to indicate a failure
Returns a JSON encoded string on success or FALSE on failure.
json_encode()
does not return null
.
If some values in the json string are null, please check this: php json_encode returning null