读取 .php 文件而不在结果中应用 HTML 和 PHP 标签
Read .php file without applying HTML and PHP tags in the result
我需要以纯文本形式读取 .php 文件。
主脚本中的文本:
<?php $data = file_get_contents('file2read.php'); ?> <pre> <?php echo $data; > </pre>
例如,我在 file2read.php 中有这个:
<tr>
<td><?php> e(enlace('/pages/index', __('index'), True, False, array('class' => 'ajax'))); ?></td>
</tr>
主脚本的输出为:
'ajax'))); ?>
我希望输出是这样的纯文本形式:
<tr>
<td><?php> e(enlace('/pages/index', __('index'), True, False, array('class' => 'ajax'))); ?></td>
</tr>
阅读纯文本
$data = file_get_contents('file2read.php');
以纯文本格式输出到网页
<pre>
<?php echo $data; ?>
<pre>
使用 htmlentities() 完成
<?php echo htmlentities($data); ?>
我需要以纯文本形式读取 .php 文件。
主脚本中的文本:
<?php $data = file_get_contents('file2read.php'); ?> <pre> <?php echo $data; > </pre>
例如,我在 file2read.php 中有这个:
<tr>
<td><?php> e(enlace('/pages/index', __('index'), True, False, array('class' => 'ajax'))); ?></td>
</tr>
主脚本的输出为:
'ajax'))); ?>
我希望输出是这样的纯文本形式:
<tr>
<td><?php> e(enlace('/pages/index', __('index'), True, False, array('class' => 'ajax'))); ?></td>
</tr>
阅读纯文本
$data = file_get_contents('file2read.php');
以纯文本格式输出到网页
<pre>
<?php echo $data; ?>
<pre>
使用 htmlentities() 完成
<?php echo htmlentities($data); ?>