2014-09-21 97 views

回答

0

這就是你如何得到第一頁的價格,工作一種方式來識別貨幣/循環投擲頁/排序他們,你就完成了。

<?php 
$string = file_get_contents('http://steamcommunity.com/market/listings/730/AK-47%20|%20Vulcan%20%28Battle-Scarred%29'); 
$attrList = explode('<span class="market_listing_price market_listing_price_with_fee">',$string); 
$N=count($attrList); 
for ($i=1;$i<$N;$i++){ 
    $prices[$i-1] = explode('</span>',$attrList[$i])[0]; 
} 
print_r($prices); 
?>