The output from that script varies depending on the values of message and id, but some sample output looks like this JSON string How to create json from php array? How to convert JSON String to Java Object?Which function is used to convert a JSON text into an object? Hot Network Questions. Solve This (? ? Is there a way to preserve the numerical keys in a php map when converting to and back from json using the standard jsonencode / jsondecode functions?The problem is in the conversion from object to array.