Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP getting a bunch of weird code \u0644\u064a\u0646\u0643 \u0627\u0644

Hello I'm getting a bunch of weird html output in users messages

e.g.

\u0644\u064a\u0646\u0643 \u0627\u0644 \u0639\u0627\u0645\u0644

I assume their aribic characters decoded?

How can I perhaps preg replace all these codes with something a little more useful? because search results are filled with pages and pages of this stuff

Perhaps even display them as they're supposed to be?

Any advice what to do with such strings and how to implement them appreciated..

Please keep in mind this stuff is mixed in been common language letters / numbers

many thanks

like image 866
Webby Avatar asked Dec 03 '25 17:12

Webby


1 Answers

These are JSON encoded characters

echo json_decode('"\u0644\u064a\u0646\u0643 \u0627\u0644 \u0639\u0627\u0645\u0644"');

Outputs : لينك ال عامل

like image 98
Serty Oan Avatar answered Dec 06 '25 06:12

Serty Oan