I used Facebook API but Json returned:
{
"id": "674271626114503",
"email": "duc2521997\u0040gmail.com"
}
How to decode '\u0040' to '@' by PHP ? Thanks.
I used Facebook API but Json returned:
{
"id": "674271626114503",
"email": "duc2521997\u0040gmail.com"
}
How to decode '\u0040' to '@' by PHP ? Thanks.
Try this, here we are using json_decode
will itself take care of \u0040
to @
<?php
ini_set('display_errors', 1);
$string='{
"id": "674271626114503",
"email": "duc2521997\u0040gmail.com"
}';
$array= json_decode($string,true); //this itself will take care of `\u0040`
echo $array["email"];
Output: duc2521997@gmail.com