What is this in php? what is it for the first time? how can I obtain the value? Thanks

Source: Internet
Author: User
What is this in php? what is this first time? how do I obtain the value ??? Thanks for the data sent from the taobao system. I want to take the value and store it in the database. How can I obtain the title, num php, and so on? what is this first time? how can I obtain the value ??? Thank you.
This data is sent from the taobao system. I want to take the value and store it in the database.
How can I obtain the title, num?
Share:
------ Solution --------------------


Don't understand .........

It looks like a multi-dimensional array...
------ Solution --------------------
echo {xx[items]->item}[0];[title]
echo {xx[items]->item}[0][num];

I don't know if it works. I haven't tested it.
------ Solution --------------------
Reference:
echo {xx[items]->item}[0];[title]
echo {xx[items]->item}[0][num];

I don't know if it works. I haven't tested it.


echo {xx[items]->item}[0][title];
echo {xx[items]->item}[0][num];

Xx is the variable you accept
------ Solution --------------------
Try
foreach($arr['items']->item as $v)
{
    echo $v->num. ' ' .$v->title."\n";
}

------ Solution --------------------
Assume that the obtained array is $ arr.

Foreach ($ arr ['items '] as $ k => $ v ){
$ Title = $ v [0] ['title'];
$ Num = $ v [0] ['num'];
// Insert a database
}
?>

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.