Jump to content

Echo an HTML Comment


mktgbill

Recommended Posts

If you want any HTML tag to appear on the screen, you need to process it with the function htmlentities():

<?php
echo htmlentities('<!-- ' . $data . ' -->',ENT_QUOTES);
?>

 

Ken

 

On the screen could mean in source or on the outputted, either way I beat you too it :)

Link to comment
https://forums.phpfreaks.com/topic/85392-echo-an-html-comment/#findComment-435708
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.