0

The outputted string in json is:

 \u062e\u0637\u0627\u06cc \u0627\u062d\u0631\u0627\u0632 \u0647\u0648\u06cc\u062a

I tried json_decode with and without JSON_UNESCAPED_UNICODE but no luck. Something like:

echo json_decode('\u062e\u0637\u0627\u06cc \u0627\u062d\u0631\u0627\u0632 \u0647\u0648\u06cc\u062a');

It returns nothing!

3
  • 2
    json_decode() requires valid json so you need to wrap the string in double quotes (which is json notation for a string): json_decode('"\u062e....\u062a"'); Commented Dec 26, 2020 at 18:17
  • Thank you @MagnusEriksson It must be wrapped with '[{"\u062e....\u062a"}]' too. Commented Dec 26, 2020 at 18:22
  • 2
    No, you don't need [{ and }]. Just the quotes: "the text". Commented Dec 26, 2020 at 18:23

1 Answer 1

0

Thanks to Magnus Eriksson's answer, it must be something like:

print_r (json_decode("...json output..."));
Sign up to request clarification or add additional context in comments.

1 Comment

Again, the [ and ] aren't necessary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.