Hi,
I am a beginning programmer in PHP. I am using WAMP and Eclipse - PDT
I'm running a script in eclipse which attempts to download articles from articlebase.com.
The script is attached. I'm getting syntax errors which I do not understand. The entire script is included.
the error a line 8 isCode:<?php $category="hello "; function get_category_links($category,$page=1) { $page = intval($page); $url = “http://www.articlebase.com/”.strtolower($category).”-articles/$page/”; $html = file_get_contents($url); if(!$html) return false; $dom = new DOMDocument(); @$dom->loadHTML($html); $xpath = new DOMXPath($dom); $elements = $xpath->query(“//div[@class='article_row']//h3/a”); $links = array ( ); if (!is_null($elements)) { foreach ($elements as $element) { $links[]=$element->getAttribute(‘href’); } } else { return false; } array_unique($links); return $links; } ?>
" Parse error: parse error in C:\wamp\www\articlebase\ab1.php on line 8 "
a screenshot of the errors is attached
Could anyone explain what the problem is.
Thanks in advance,
KC



Reply With Quote


Bookmarks