Reputation: 151
In a PHP page, how can I write PHP documentation without it being rendered?
Example of what I am trying to do:
<?php _e( 'Error msg, please manually add <?php echo "whatever"; ?> to this
file, 'my-text-domain' ); ?>
Upvotes: 2
Views: 62
Reputation: 782693
Replace <
and >
characters with <
and >
entities to display them literally, just like you would in ordinary HTML:
<?php _e( 'Error msg, please manually add <?php echo "whatever"; ?> to this file, 'my-text-domain' ); ?>
You could also call the htmlentities()
function to do it automatically:
<?php _e( htmlentities('Error msg, please manually add <?php echo "whatever"; ?> to this file, 'my-text-domain') ); ?>
Upvotes: 7