Fix garbled message text: Difference between revisions

Jump to navigation Jump to search
Line 119: Line 119:
echo "encoded string: " . $encoded . PHP_EOL; // print "\ud83d\udc18"
echo "encoded string: " . $encoded . PHP_EOL; // print "\ud83d\udc18"
echo "decoded string: " . json_decode($encoded, true) . PHP_EOL; // print 🐘
echo "decoded string: " . json_decode($encoded, true) . PHP_EOL; // print 🐘
</pre>
Using PHP [https://wiki.php.net/rfc/unicode_escape Unicode Codepoint Escape Syntax]
<pre>
echo "\u{8c61}" . PHP_EOL; // print 象
echo "\u{0001f418}" . PHP_EOL; // print 🐘
</pre>
</pre>


Navigation menu