Monday, December 19, 2011

php echo a href

SkyHi @ Monday, December 19, 2011
As Russell alluded to, there is no need ot open <?php again and echo again. That will only break stuff...you are already echoing.
Drogyn's suggestion would work too, but it's not quite as clean.

However, Russell's example might not work for you because, when your variable is an element of an array, you need to concatinate it like this:

<?php
echo "User";

...note that the variable is inside of ". and ."

Or you can put the variable in {} like:

echo "User";

But the way Russel showed you would work if you were using a simple variable like:

echo "User";

OR

<?php

echo "Read more...";

OR

<a href="template.php?aid=<?php echo $aid; ?>">Read more...</a>


REFERENCES
http://www.webmasterworld.com/forum88/11539.htm

http://www.daniweb.com/web-development/php/threads/105613