Trick to create string with HTML tags in PHP

If you are too lazy to perform stripping any kind of  ‘forbidden’ tags in string, like ‘<?’ or ‘ ” ‘ symbol, this is a method:

Example:

<?

$str = <<<EOD
<html><body>
<p>Welcome! Today is the <?php echo(date(‘jS’)); ?> of <?= date(‘F’); ?>.</p>
</body></html>
Text “outside” of the HTML block.
EOD;

echo $str;

?>

It gonna makes your job faster, right?😉

One Response to Trick to create string with HTML tags in PHP

  1. simran says:

    hi plz dera can u help me in my project login page,i don’t know how to make it,,plzzzz reply as soon as possible.i have only 4 hours left to submit my project

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: