0
解析後,鏈接多個陣列我已經解析了很多differend XML來檢查,如果 - 例如 - 文檔是否在線,並把它變成一個數組和「回聲」的在線文檔是這樣的:從XML
<?php
//
//Array
$externdoc[123] = "Example 1";
$externdoc[456] = "Example 2";
$externdoc[789] = "Example 3";
$externdoc[2562] = "Example 4";
$externdoc[78545] = "Example 5";
// func
foreach($externdoc as $nr => $name)
{
$xml = simplexml_load_file("http://www.example.com/docs.php?live_id=".$nr);
if($xml->liveDocs->download!=0)
{
echo 'Download: '. $xml->liveDocs->download.' '.$name.;
}
}
?>
這裏是我的問題有趣的部分。我想每個陣列有不同的URL像這樣的鏈接:
<?php
//
//Array
$externdoc[123] = "Example 1";
$externdoc [url] = 'http://www.example.com/docs/1.php';
$externdoc[456] = "Example 2";
$externdoc [url] = 'http://www.example.com/docs/2.php';
$externdoc[789] = "Example 3";
$externdoc [url] = 'http://www.example.com/docs/3.php';
$externdoc[2562] = "Example 4";
$externdoc [url] = 'http://www.example.com/docs/4.php';
$externdoc[78545] = "Example 5";
$externdoc [url] = 'http://www.example.com/docs/5.php';
// func
foreach($externdoc as $nr => $name)
{
$xml = simplexml_load_file("http://www.example.com/docs.php?live_id=".$nr);
if($xml->liveDocs->download!=0)
{
echo '<a href="HOW DO I LINK IT?"> Download: '. $xml->liveDocs->download.' '.$name.;
}
}
?>
任何建議,歡迎!
非常感謝您的支持! – Jasper
@Jasper:請參閱http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – hakre