You cannot have PHP echo more than PHP code to evaluate, because PHP interprets your code in a single pass. If you have, say, <?php echo '<?php echo "hello"; ?>'; ?> <?php echo '<?php echo "hello"; ?>'; ?> <?php echo '<?php echo "hello"; ?>'; ?> , you will literally get the text <?php echo "hello"; ?> <?php echo "hello"; ?> as output, and the interpreter will not touch it.
You can, however, enter and exit PHP as desired:
<?php echo "I am going to be interpreted by PHP."; ?> I am not interpreted by PHP. <?php echo "But I am again."; ?>
If you think you need to output PHP code that is being reviewed, there is always a better way to accomplish this. If you give a concrete example of what you are trying to accomplish (the real thing), then people here at SO will be happy to help.
Andrew
source share