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