1.所用php变量名为$recent_tests,是一个二维数组,示例如下:
1 $recent_tests[0]["test_url"] = www.baidu.com
2 $recent_tests[0]["result_url"] = www.baidu12345678_result.com
3 $recent_tests[1]["test_url"] = www.https://cnpvgvb1od054.pvgl.sap.corp:8443/store/.com
4 $recent_tests[1]["result_url"] = www.https://cnpvgvb1od054.pvgl.sap.corp:8443/store/_result.com
2.其中"test_url"为页面显示内容,"result_url"为链接定向地址,即href值。
3.代码如下:
1 <table class="table table-hover">
2 <thead>
3 <tr>
4 <th>#</th>
5 <th>URL</th>
6 </tr>
7 </thead>
8 <tbody>
9 <tr>
10 <th scope="row">1</th>
11 <td><a href="<?php $recent_tests[0]["result_url"] ?>" target="_blank"><?php echo $recent_tests[0]['test_url']; ?></a></td>
12 </tr>
13 <tr>
14 <th scope="row">2</th>
15 <td><a href="<?php $recent_tests[1]["result_url"] ?>" target="_blank"><?php echo $recent_tests[1]['test_url']; ?></a></td>
16 </tr>
17 </tbody>
18 </table>
4.页面显示如下:
![](https://images2015.cnblogs.com/blog/868550/201607/868550-20160726182613388-432944083.png)