我无法弄清楚如何从这个数组中获取我需要的值 ::: 我需要 3 辆车的值是 .
- [class] => span3 scrape_img图片 Href & 图片 src
- [class] => price scrape_price价格
- [class] => scrape_make制作
- [class] => scrape_year年份
我试图通过阅读PHP 数组文档来解决这个问题,但没有取得多大成功。
Array
(
[query] => Array
(
[count] => 12
[created] => 2013-02-04T17:46:34Z
[lang] => en-US
[results] => Array
(
[div] => Array
(
[0] => Array
(
[class] => span3 scrape_img
[span] => Array
(
[class] => scrape
[a] => Array
(
[href] => http://cant-reveal-this.com/cars/hyundai/ix35-2-0gls-auto/
[img] => Array
(
[alt] => Featured Image
[src] => /wp-content/uploads/2013/02/01863-270x150.jpg
)
)
)
)
[1] => Array
(
[class] => price scrape_price
[p] => From R249,900
)
[2] => Array
(
[class] => span3 scrape_img
[span] => Array
(
[class] => scrape
[a] => Array
(
[href] => http://cant-reveal-this.com/cars/hyundai/ix35-2-0gls/
[img] => Array
(
[alt] => Featured Image
[src] => /wp-content/uploads/2013/02/1930-270x150.jpg
)
)
)
)
[3] => Array
(
[class] => price scrape_price
[p] => From R239,900
)
[4] => Array
(
[class] => span3 scrape_img
[span] => Array
(
[class] => scrape
[a] => Array
(
[href] => http://cant-reveal-this.com/cars/ford/everest-3-0-tdci-xlt-4/
[img] => Array
(
[alt] => Featured Image
[src] => /wp-content/uploads/2013/02/1876-270x150.jpg
)
)
)
)
[5] => Array
(
[class] => price scrape_price
[p] => From R279,900
)
)
[span] => Array
(
[0] => Array
(
[class] => scrape_make
[strong] => Make
[content] => hyundai
)
[1] => Array
(
[class] => scrape_year
[strong] => Year
[content] => 2011
)
[2] => Array
(
[class] => scrape_make
[strong] => Make
[content] => hyundai
)
[3] => Array
(
[class] => scrape_year
[strong] => Year
[content] => 2011
)
[4] => Array
(
[class] => scrape_make
[strong] => Make
[content] => ford
)
[5] => Array
(
[class] => scrape_year
[strong] => Year
[content] => 2011
)
)
)
)
)