泥棒プログラム
669 ワード
$url = "http://weather.tq121.com.cn/detail.php?city=$_GET[city]"; //
$fp = @fopen($url, "r") or die(" ");
$fcontents = file_get_contents($url);
eregi("<img src=\"images/20080821.gif\" width=\"480\" height=\"55\" border=\"0\"></a></td>(.*)<td width=\"21\" valign=\"top\"> </td>", $fcontents, $regs);
$regs[1]=str_replace("src=\"../images/","src=\"http://weather.tq121.com.cn/images/",$regs[1]);
echo $regs[1];
関数:file_ゲットするcontensts