我有一个网站,我想在同一个PHP代码中显示许多不同的文件类型,但显示.txt
或.php
文件有点困难。这是我的代码:
<?php
$display_files = "
<div class=\"fileHoler\">
<img src=\"path/to/image-file\" />
</div>
<div class=\"fileHoler\">
<video width=\"460\" height=\"auto\" controls>
<source src=\"path/to/video-file\">
</video>
</div>
<div class=\"fileHoler\">
path/to/text-file or path/to/php-file // How can I show the file>???
</div>
";
?>
<?php echo $display_files; ?>
由于<img>
和<video>
标签,这完全显示了图像和视频文件,但有什么我可以用来显示类似方法的txt或php文件吗?