Syntax error Add PHP variable inside echo statement as href link address?

Add PHP variable inside echo statement as href link address?



HTML in PHP

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

or

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

PHP in HTML

<a href="<?php echo $link_address;?>"> Link </a>
Updated on: 2020-04-07T10:59:20+05:30

4K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements