【发布时间】:2015-02-02 17:17:04
【问题描述】:
所以我试图在我的另一个网站上显示一个列表,一切正常,但只存储了“标题”属性的第一个单词。我知道整个标题是从其他网站检索到的,所以我如何让它存储所有它。
如果有帮助,这里是代码。
<?php
include "simple_html_dom.php";
$page = file_get_html("http://www.blade-edge.com/images/KSA/Flights/craft.asp?r=true&db=dunai");
echo "<table id=list>";
foreach($page->find('html/body/div/div[2]/ol/a') as $key=>$element) {
if ($element->title != "No craft within this SOI"){
$ships[$key] = $element->plaintext;
$shipTitles[$key] = $element->title;
$shipLinks[$key] = $element->href;
echo "<tr>";
echo "<td title =".$shipTitles[$key]." >";
echo $ships[$key];
echo "</td>";
echo "</tr>";
}
}
echo "</table>";
?>
【问题讨论】:
标签: php html title simple-html-dom