0
如何使用以下代碼來提取包含特殊字符的內容?目前,代碼解碼特殊字符並返回以下內容。如何使用PHP Dom代碼來提取(提取)特殊字符
["><font size="2">1</font></span>]
$url = 'http://acbar.org/ManagejobDetails.aspx?id=' . $jobid ;
$html_dom = new simple_html_dom() ;
$html_dom = file_get_html($url) ;
foreach($html_dom->find('table [cellspacing=3] tr') as $e) {
$children = $e->children() ;
$size = count($children) ;
if($size == 2) {
$label = $children[0]->children(0);
$value = $children[1]->children(0);;
$createXML .= createRSSFile($label,$value);
}
}
不工作。 @diEcho '$ url ='http://acbar.org/ManagejobDetails.aspx?id='。 $ jobid; $ html_dom = new simple_html_dom(); $ html_dom = file_get_html($ url); $ a = htmlentities($ html_dom); $ b = html_entity_decode($ a); foreach($ b-> find('table [cellspacing = 3] tr')as $ e){ $ children = $ e-> children(); $ size = count($ children);如果($ size == 2){ $ label = $ children [0] - > children(0); $ value = $ children [1] - > children(0);; $ createXML。= createRSSFile($ label,$ value); }' – 2011-12-24 07:02:13
@MaihanNijat:請閱讀鏈接上的第一個例子。我還用另一種方法更新了我的答案 – diEcho 2011-12-24 07:08:07
謝謝。第二種方法奏效。 – 2011-12-24 07:50:46