PHP JSON type

Source: Internet
Author: User

Sometimes it is necessary to return data in JSON format, JSON is a very common way of data transmission. Here is one of the simplest examples. That means you just need to set the document type to JSON.

<?phpheader (' Content-type:application/json; Charset=utf-8 '); $s = array (' 1 ' = ' Hello World ', ' 2 ' = = ' Linux $show = Json_encode ($s); Echo $show; >

A browser-accessible effect will look like this. Of course, you need a browser to install the JSONVIEWR plugin. Because the chrome store is always on the go, it's not possible to install the plugin and look at the face. If happen to go up, that is good to do, in the shop to search Jsonview on it. Sorry, I went up again.


PHP JSON type

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.