What does curly braces mean?

Source: Internet
Author: User
$result={"total":2,"pages":1,"pic":[{"id":"1","name":"1"},{"id":"1","name":"1"}]}

What does the ① curly brace mean.

② How to get the name in pic

Trouble Big God doubts, thank you ...

Reply content:

$result={"total":2,"pages":1,"pic":[{"id":"1","name":"1"},{"id":"1","name":"1"}]}

What does the ① curly brace mean.

② How to get the name in pic

Trouble Big God doubts, thank you ...

Lou Zhu, your writing is not right, this $result , should be sent over the json bar, then it should be a string ah, you need to use json_decode to parse the object AH:

$result = json_decode('{"total":2,"pages":1,"pic":[{"id":"1","name":"1"},{"id":"1","name":"1"}]}');$name = $result->pic[0]->name;

You look at the concepts of arrays, objects, and JSON.

  • Related Article

    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.