coding problem HTML format in php variable

by 2 replies
3
How to I place HTML code (basic code) into a php variable I have various methods in cluding

<<<EOD
<div>SOME HTML</div>
EOD;

but no luck it just types out the tags

It is for a email form auto response
I have googled it but cant find anything that works

My varibale is
$link = '<a href="#">click here</a>';
#programming #coding #format #html #php #problem #variable
  • This should go in the programming forum, but here's the code:

    <?php

    $link = "<a href=\"somewhere\">test link</a>";

    echo "$link";

    ?>
  • There a couple of ways.

    Do what Christian Little says

    Just echo the html:
    echo '<a href="#">click here</a>';

    End the php around the html
    <?php
    loads of code
    ?>
    <a href="#">click here</a>
    <?php
    more php code
    ?>

Next Topics on Trending Feed