Add PHP variable inside echo statement as href link address?

Try like

HTML in PHP :

echo "<a href="".$link_address."">Link</a>";

Or even you can try like

echo "<a href="https://stackoverflow.com/questions/18916966/$link_address">Link</a>";

Or you can use PHP in HTML like

PHP in HTML :

<a href="https://stackoverflow.com/questions/18916966/<?php echo $link_address;?>"> Link </a>

Leave a Comment