Is it possible for the PHP json_encode
function do not convert empty string values to null?
UPDATE
I can not replicate this behaviour in clear conditions, and looks like it's already a default for this function.
This is already the default behavior.
json_encode(['test' => '']);
generates:
{"test":""}
No that i know of, but you could do this:
array_walk_recursive($value, function (&$item, $key) {
$item = null === $item ? '' : $item;
});