user1616704 user1616704 - 1 year ago 56
PHP Question

Echo a String In PHP that contains <? ?> or <?php ?> and a PHP function

How can I echo a string that contain

For example,

$txt="<? echo get_block('$guid');?>";

The above result outputs nothing.

Answer Source
$txt="<? echo get_block('$guid');?>";
echo highlight_string($txt, true);

Highlight String will result in the following output .

<?php echo get_block('1'); ?>