Strange PHP output! Please help me see the strange characters I haven't understood for a day.

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.