2

Ive been trying to decode this for a long while, I need to be able to decode this:

\ud835\udcdf\ud835\udcea\ud835\udcfd\ud835\udcfb\ud835\udcf2\ud835\udcec\ud835\udcf2\ud835\udcea

Into this: ""

What encoding is this? Can html_entity_decode do this?

Shawn
  • 3,583
  • 8
  • 46
  • 63
LonniE
  • 99
  • 2
  • 9
  • 1
    Possible duplicate of [How to decode Unicode escape sequences like "\u00ed" to proper UTF-8 encoded characters?](http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-cha) – lafor Mar 13 '17 at 18:49
  • Just tried that post, didn't work. – Neil Mar 13 '17 at 18:51

1 Answers1

1

Here's a way to do it:

<?php

$str = "\ud835\udcdf\ud835\udcea\ud835\udcfd\ud835\udcfb\ud835\udcf2\ud835\udcec\ud835\udcf2\ud835\udcea";
echo json_decode('"'.$str.'"');

?>
Neil
  • 14,063
  • 3
  • 30
  • 51
  • NICE!! Thank you soo much! I've spent hours on this and it was that simple :D Thanks again :) – LonniE Mar 13 '17 at 18:57
  • Thanks for the feedback! Votes cast by those with less than 15 reputation are recorded, but do not change the publicly displayed post score – LonniE Mar 13 '17 at 18:59
  • Huh, really? Does mark as solution work? (And it helps future users finding the post). – Neil Mar 13 '17 at 19:00
  • Need to wait another minute before i can mark it as solved :) – LonniE Mar 13 '17 at 19:01
  • `echo json_decode('"'.'\ud835\udcdf\ud835\udcea\ud835\udcfd\ud835\udcfb\ud835'.'"');` not working at all. – Rahmat Waisi Sep 14 '22 at 07:57