【发布时间】:2018-10-01 19:11:27
【问题描述】:
我将带有代码的 php 文件“test.php”放入 phar 存档中:
<?php
echo 'hello';
?>
如何启动文件并在屏幕上显示hello?使用状态文件,例如 txt 这样的文件,但使用 PHP 则没有:
echo file_get_contents('phar://archive.phar/test.php');
【问题讨论】:
-
你使用
require,而不是file_get_contents。