Using php variable in href html links
here is what i am trying to do
$store='something.com'; echo '<div><h3>click on</h3><a href='.$store.'>host</a></p></div>';
what it output is
instead it should use something.com as link and output need to be host.
try for sometime to do it my own but havn't achieved any success.
I am agree with the Answer of Ma'moon and it is right.
Php code does not work inside the single quotes ' ', so its required to place code inside the double quotes " ".
You can also use following method instead ↓
$store='something.com'; echo "<div><h3>click on</h3><a href='$store'>host</a></p></div>";
This code will help you out:
<?php $store='something.com'; echo '<div><h3>click on</h3><a href="'.$store.'">host</a></p></div>';
Note the double quotes (") between the string concatenation (') this is needed by the browser to make render the proper href element.