<?php
if(isset($data) && !empty($data)) {
foreach ($data as $row) {
@$count += 1;
$keyword = htmlspecialchars($row['Keyword']);
$suburb = htmlspecialchars($row['Suburb']);
$postcode = htmlspecialchars($row['Postcode']);
$status = htmlspecialchars($row['Status']);
$info = htmlspecialchars($row['Info']);
@$table_row .= "<tr><td>$count</td><td>$keyword</td><td>$suburb</td><td>$postcode</td><td>$status</td><td>$info</td></tr>";
}
echo @$table_row;
}
?>
&#39; Info&#39; 列,我想将其作为网址引入。
干杯, 柯蒂斯 http://www.homegiraffe.com.au
答案 0 :(得分:1)
$info = '<a href="' . $row['Info'] . '">' . htmlspecialchars($row['Info']) . '</a>';
这就是答案。感谢Chris85的帮助!
答案 1 :(得分:0)
你可以用这个
<?php
if(isset($data) && !empty($data)) {
foreach ($data as $row) {
@$count += 1;
$keyword = htmlspecialchars($row['Keyword']);
$suburb = htmlspecialchars($row['Suburb']);
$postcode = htmlspecialchars($row['Postcode']);
$status = htmlspecialchars($row['Status']);
$info = htmlspecialchars($row['Info']);
?>
<tr><td><?php echo $count;?></td><td><?php echo $keyword;?></td><td><?php echo $suburb;?></td><td><?php echo $postcode?></td><td><?php echo $status;?></td><td><a href="<?php echo $row['Info'];?>"><?php echo $info;?></a></td></tr>;
<?php
}
}
?>
并且效果非常好:)。