I am trying to use this code:
<?php echo json_decode('"\uD83D\uDE00"'); ?>
When I am using this code I am getting this value :
😀
But when I am trying to use this code using some variable like this:
<?php
$var = "\uD83D\uDE00";
echo json_decode('"{$var}"');
echo "{$var}";
?>
I am getting this as output:
{$var}\uD83D\uDE00
I have tried many things but nothing is working what can be the best way to do this.
It is strange as demand but funny, try this :)
<?php
$var = "\uD83D\uDE00";
echo json_decode('"'.$var.'"');
?>
Try this:
<?php
$var ='"\uD83D\uDE00"';
echo json_decode($var);
?>
Please try this
<?php
$var = "\uD83D\uDE00";
echo json_decode($var);
echo $var;
?>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.