Avatar of hankknight
hankknight
Flag for Canada asked on

PHP: Get text content scrambled by UTF-8

Somehow the data in a MySQL database ended up in a format that looks like this.

Using PHP, is there any way I can get the actual text from this?

I tried using mb_convert_encoding() and I also tried using utf8_decode() but I cannot figure out how to get actual text content from this:

"0S"0h"0o"0r"0t"0l"0i"0s"0t"0e"0d"0 "0f"0o"0r"0 "0t"0h"0e"0 "02"00"01"01"0 "0F"0r"0a"0n"0k"0 "0O "0C"0o"0n"0n"0o"0r"0 "0S"0h"0o"0r"0t"0 "0S"0t"0o"0r"0y"0 "0A"0w"0a"0r"0d"0,"0 "0t"0h"0e"0 "0w"0o"0r"0l"0d"0'"0s"0 "0r"0i"0c"0h"0e"0s"0t"0 "0s"0h"0o"0r"0t"0 "0s"0t"0o"0r"0y"0 "0p"0r"0i"0z"0e"0 "0 "0 "0 "0""0T"0r"0a"0f"0f"0o"0r"0d"0'"0s"0 "0a"0l"0c"0h"0e"0m"0i"0c"0a"0l"0 "0m"0i"0x"0i"0n"0g"0 "0o"0f"0 "0r"0e"0s"0e"0a"0r"0c"0h"0,"0 "0f"0a"0b"0l"0e"0,"0 "0p"0a"0t"0h"0o"0s"0,"0 "0a"0n"0d"0 "0p"0l"0o"0t"0 "0y"0i"0e"0l"0d"0s"0 "0i"0m"0p"0r"0e"0s"0s"0i"0v"0e"0 "0r"0e"0s"0u"0l"0t"0s"0."0""0-"0R"0a"0i"0n"0 "0T"0a"0x"0i"0 "0 "0 "0 "0""0I"0 "0l"0o"0v"0e"0 "0M"0a"0t"0h"0e"0w"0 "0J"0."0 "0T"0r"0a"0f"0f"0o"0r"0d"0'"0s"0 "0i"0m"0a"0g"0i"0n"0a"0t"0i"0o"0n"0!"0 "0I"0n"0 "0h"0i"0s"0 "0w"0o"0r"0l"0d"0,"0 "0s"0c"0i"0e"0n"0t"0i"0s"0t"0s"0 "0c"0l"0o"0n"0e"0 "0J"0e"0s"0u"0s"0 "0C"0h"0r"0i"0s"0t"0,"0 "0f"0i"0s"0h"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0h"0e"0 "0e"0l"0e"0v"0a"0t"0o"0r"0 "0t"0a"0k"0e"0s"0 "0y"0o"0u"0 "0t"0o"0 "0a"0n"0o"0t"0h"0e"0r"0 "0f"0l"0o"0o"0r"0 "0a"0l"0t"0o"0g"0e"0t"0h"0e"0r"0,"0 "0a"0n"0d"0 "0i"0t"0 "0t"0u"0r"0n"0s"0 "0o"0u"0t"0 "0t"0o"0 "0b"0e"0 "0a"0 "0t"0h"0o"0r"0o"0u"0g"0h"0l"0y"0 "0e"0n"0j"0o"0y"0a"0b"0l"0e"0 "0r"0i"0d"0e &"0 "0a"0 "0m"0u"0s"0t"0 "0f"0o"0r"0 "0r"0e"0a"0d"0e"0r"0s"0 "0l"0o"0o"0k"0i"0n"0g"0 "0f"0o"0r"0 "0s"0o"0m"0e"0t"0h"0i"0n"0g"0 "0f"0r"0e"0s"0h"0 "0a"0m"0i"0d"0 "0a"0 "0s"0e"0a"0 "0o"0f"0 "0s"0t"0a"0l"0e"0 "0b"0o"0o"0k"0s"0.  "0Q"0u"0i"0l"0l"0 "0a"0n"0d"0 "0Q"0u"0i"0r"0e"0 "0

Open in new window

PHPMySQL Server

Avatar of undefined
Last Comment
Ray Paseur

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ray Paseur

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
hankknight

ASKER
Thanks, Ray, that was very helpful!
Ray Paseur

Thanks for the points -- best of luck with it, ~Ray
jjmelo

Hello,

Ai need of function

$str = <<<STR
"0S"0h"0
STR;

change:

$str = <<<STR
.$var.
STR;

erro...
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Ray Paseur

@jjmelo:  Consider posting a question of your own here!  We are glad to help!