腦友記廣場 -> 新手上路 -> RTHK question 登錄 -> 註冊 -> 回復主題 -> 發表主題

felixfwk 2011-02-16 15:12
I am doing a project to create the links so that the blind can be used easily. The code below is no problem, but when i added a line
$line=eregi_replace("<div class="desc">(.*)</div>","",$line);
to remove unnessary words. I got Parse error: syntax error, unexpected T_STRING in /home/domains/abc.com/public_html/blind.php on line 15
Please tell me what's wrong. The code is stated below

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?
$requesturl = "http://programme.rthk.hk/channel/radio/programme.php?name=/elderlyengmusic&p=4586&m=archive&page=1&item=500";
if ($fp = fopen("$requesturl","r")){
while(!feof($fp))
{
$line .= fgets($fp,556);
}
fclose($fp);
}
eregi("<!---program name end--->(.*)<!-- page navigator bar -->",$line,$matches);
$line=$matches[1];
$line=eregi_replace("<div class="desc">(.*)</div>","",$line);
$allowed_tags = "<a>,<span>,<li>";
$line = strip_tags($line, $allowed_tags);
echo $line;
?>
</html>

maninnet 2011-02-18 07:13
" 要加 \
$line=eregi_replace("<div class=\"desc\">(.*)</div>","",$line);


查看完整版本: [-- RTHK question --] [-- top --]


Powered by PHPWind v4.0.1 Code © 2003-05 PHPWind
Gzip enabled

You can contact us