PHP encoding "les validations d'entr\u00e9es"
I have text in this format les validations d'e开发者_JAVA百科ntr\u00e9es
instead of les validations d'entrées
.
This is from Twitter .json API and I would like to translate the \u00e9
to the é
but can't find a way to do it.
I suppose it's unicode so how can I translate those characters in PHP?
Sample of code that I already have:
$this->jsonArray = json_decode($this->jsonData, true);
//... Loop ...
$output .=' <li class="twit">'.$this->jsonArray[$x]['text'] //....
Use json_decode:
$raw = "{\"data\":\"les validations d'entr\u00e9es\"}";
var_dump(json_decode($raw));
Result:
object(stdClass)[2]
public 'data' => string 'les validations d'entrées' (length=26)
Alright, I thought it was Unicode but it was UTF8... Using the PHP method utf8_decode solve the problem. Thank you Eric to point me out the json_decode but it seems that it requires to have something more.
精彩评论