2010-06-07 136 views

回答

0

你只需要解析该文件并将其插入数据库。快速查看链接显示,它似乎全部由分号分隔。看看explode()

为了让您的结果,简单地做

$splitContents = explode($rawContents); 
$counter=0 
while($counter <= count($splitContents)) { 
    $Price=$splitContents[$counter++] 
    $Percent_change=$splitContents[$counter++] 
    $Company_Name=$splitContents[$counter++] 
    $Company_Code=$splitContents[$counter++] 
    $Volume=$splitContents[$counter++] 
    mysql_query("INSERT INTO ...."); 
} 
+0

嗯,为什么投票呢? – TheLQ 2010-06-07 22:53:25

0

在你笨类,应该叫file_get_contents功能以指定URL:

$contents = file_get_contents('url here'); 

现在,你必须在$contents变量指定URL的数据,只要你喜欢,你可以操纵。

+0

感谢您的帮助!但我不知道我如何可以提取数据并保存到数据库..任何想法SArfraz先生? – devzone 2010-06-07 21:35:08