Reputation: 17
I need to read a .php file as plain text.
Text in main script:
<?php $data = file_get_contents('file2read.php'); ?> <pre> <?php echo $data; > </pre>
For example, I have this in file2read.php:
<tr>
<td><?php> e(enlace('/pages/index', __('index'), True, False, array('class' => 'ajax'))); ?></td>
</tr>
The output of the main script is:
'ajax'))); ?>
I want that output to be something like this in plain text:
<tr>
<td><?php> e(enlace('/pages/index', __('index'), True, False, array('class' => 'ajax'))); ?></td>
</tr>
Upvotes: 0
Views: 590
Reputation: 170
Read as plain text
$data = file_get_contents('file2read.php');
Output to a web page in plain text
<pre>
<?php echo $data; ?>
<pre>
Upvotes: 2