Strange PHP output! Please help me to see how many strange characters I haven't understood in a day. first, I started learning php and wrote a process of outputting JSON after reading the database.
It seems that the result is correct ~~~ Then I go to a website to prompt me
So I searched for half a day and found that there were four inexplicable things in front of the string that I didn't know where to come from...
Where does this come from? = How can I get rid of it...
Function index ()
{
$ Cc = new DemoDao ();
$ Resu = $ cc-> index ();
$ Json = json_encode ($ resu );
$ Json = urldecode ($ json );
$ Total = 24;
$ Json = "{". '"total"'. ": $ total,". '"rows"'. ":". $ json ."}";
Echo $ json;
}
Finally, output the Json
Please help me see it ~!!!!!!!!!!!! UTF-8 encoding
Reply to discussion (solution)
???? {"Total": 24, "rows": [{"id": "1", "name": "Flowers", "number": "5 "}, {"id": "3", "name": "All", "number": "0" },{ "id": "4", "name ": "Grocery", "number": "0"}]}
Directly select all copies to copy the previous four items.
Apparently the bom header