P
P
PO6OT2015-04-10 13:46:15
PHP
PO6OT, 2015-04-10 13:46:15

How to disable nested code in php?

How to configure php.ini so that the nested script does not work?
So this script:
<?php
$echo = "<?php echo 'some text'; ?>";
echo $echo;
?>
should output "<?php echo 'some text'; ?>", not "some text".
The point was that the code nested in echo was executed because the script itself was not requested directly, but through another script that connected it. That is, in script 1 it was written <?php include('path/to/script2'); ?>.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Melkij, 2015-04-10
@melkij

should output "<?php echo 'some text'; ?>", not "some text".

Tell us how you got it.
I have two dozen versions of PHP on hand right now, from 5.1 to 5.6, all returning <?php echo 'some text'; ?> as they should.

O
OnYourLips, 2015-04-10
@OnYourLips

How to configure php.ini so that the nested script does not work?
Delete PHP. Then the contents of the script will simply be displayed, as you want.

Z
zooks, 2015-04-10
@zooks

<?php
echo <<<EOT
&lt;?php echo 'some text'; ?&gt;
EOT;
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question