0
如何從$avatar
數組中檢索結果?
這是我的嘗試:
我希望得到以下(URL):
代碼:關於php的幾個問題preg_match_all
<div id="fotoprofilo"><img src="http://images.instagram.com/profiles/profile_19347213_75sq_0000.jpg"></div>
和PHP:
$s2 = file_get_contents("http://followgram.me/user");
$avatar = "";
preg_match_all('/fotoprofilo\s*"><img src=".*\b">/', $s2, $avatar);
print_r($avatar[0]);
1)如何是結果的工作?
2)它會找到它嗎? (因爲我看不到價值)
在此先感謝。
[不要使用正則表達式來解析HTML](http://stackoverflow.com/q/1732348/112968) – knittl 2012-03-04 15:19:44
此外,您的服務器必須配置爲允許file_get_contents通過http: //默認情況下,它只能用於本地文件 – knittl 2012-03-04 15:21:48
#knittl它實際上適用於我:)(http),我正在檢查不使用...另外,結果如何工作?! – funerr 2012-03-04 15:24:38