echo“<?php echo'Hello'?>”; 它什么也没输出。 是否可以在echo中执行php代码。 我们如何回应php标签

echo "<?php echo 'Hello' ?>"; It outputs nothing . Is it possible to execute php code in echo . And How can we echo php tags.

Try using htmlentities to make sure it outputs properly to your browser:

echo htmlentities("<?php echo 'Hello' ?>");

It's outputing, but browser just not displaying it.

Try

echo "<xmp><?php echo 'Hello' ?></xmp>";

You can use '&lt;' instead of < sign and '&gt;' instead of > sign

echo "&lt;?php echo 'Hello' ?&gt;";