現在holidays.xml
をlogged_in.php
の表に渡しています。ある値を別の値のリンクにします
holidays.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<item>
<title>Luxurious Jamaican holidays | 40% Discount On Accommodation - Book Now!</title>
<link>http://www.numyspace.co.uk/~cgel1/holidays/Jamaica.html</link>
<description>7 nights at The Golden Palm, Montego Bay travelling from Newcastle with Fly Jamaica</description>
<pubDate>Sun, 13 Feb 2011 11:58:17 GMT</pubDate>
<guid>http://www.numyspace.co.uk/~cgel1/holidays/Jamaica.html</guid>
</item>
</channel>
</rss>
logged_in.php
<?php
// load the xml file into a simplexml instance variable
$holiday = simplexml_load_file('holidays.xml');
// draw a table and column headers
echo "<table border=\"0\">";
/* echo " <th>Title</td>
<th>Link</td>
<th>Description</td>
<th>Published Date</th>";
*/
// iterate through the item nodes displaying the contents
foreach ($holiday->channel->item as $holiday) {
echo "<tr>";
echo "<td>{$holiday->title}</td>";
echo "<td>{$holiday->link}</td>";
echo "<td>{$holiday->description}</td>";
echo "<td>{$holiday->pubDate}</td>";
echo "</tr>\n";
}
echo "</table>";
?>
私はecho "<td>{$holiday->link}</td>";
がecho "<td>{$holiday->title}</td>";
のリンクになりたいので、リンクはhrefのタイトルのタイトルになります。これを行う簡単な方法はありますか?
私はほとんどそこにいた、これは完璧なおかげで働いた。 –