Created
October 19, 2015 13:13
-
-
Save pepf/479d6bc69b24e2aacfb6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//encoding a fancy emoji to ascii | |
$a = json_encode("💩"); //json_encode casts emoji string to readable ascii | |
var_dump($a); | |
//other way around | |
echo "\n\n<br/><br/>"; | |
//based on the encoded variable | |
echo json_decode($a); | |
//from scratch, mind the extra "" set | |
echo json_decode('"\ud83d\udca9"'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment