使用PHP以HTML格式显示的.csv文件中的可点击URL

I have a few .csv files that store car accessories for my dealership and are displayed on a webpage using PHP by logging onto a local computer I've setup as a web server. I'd now like to add a row, holding URLs that point to images for each accessory. I know you can insert a link into a cell by using =HYPERLINK("http://www.google.com") and it works while inside Excel/Numbers, but once saved as a .csv it doesn't do anything. Also wondering if the PHP code I have setup to display the .csv files may cause an issue.

If anyone has any idea on how I can insert a URL into a .csv and have a clickable URL using PHP displayed in a web browser I'd greatly appreciate it!

Here is my PHP code for those interested:

<?php
 echo "<html><body><table>

";
 $f = fopen("csv/exterior.csv", "r");
 while (($line = fgetcsv($f)) !== false) {
    echo "<tr>";
    foreach ($line as $cell) {
            echo "<td>" . htmlspecialchars($cell) . "</td>";
    }
    echo "</tr>
";
  }
 fclose($f);
 echo "
</table></body></html>";
?>
doudu5498
doudu5498 我明白了,我是通过Excel镜头观看的。这不适合你。您可能想要做的是弄清楚如何将链接放入PHP。您可以将链接存储为Excel中的文本,然后在使用PHP循环时查找链接中的某些指示字符,而不是显示文本,请插入链接。
4 年多之前 回复
doutao4480
doutao4480 我以为网络浏览器无法显示.xlsx文件。我不对吗?
4 年多之前 回复
dongwu8050
dongwu8050 csv文件仅用于数据。如果你想要点击链接,为什么不保存为.xlsx?
4 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐