Hyperlink using PHP variable
Posted 23 May 2005 - 08:40 AM
$web = $info['Website'];
Posted 23 May 2005 - 12:46 PM
<a href="$web"></a>should be:
I don't know if you just left the echo out or what, but that line should work...
with $web being www.example.com: output is
Posted 29 May 2005 - 06:01 PM
The parentheses aren't need and why use escape characters when they're not needed? I wouldn't suggest hiding variables inside of double quotes, at least not when you're using Dreamweaver because Dreamweaver won't highlight variables inside of quotes.echo("<a href=\"$web\">$web</a>");
I just don't believe it's a good habit to get into.
echo '<a href="' . $web . '">' . $web . '</a>';
If you know that your contents are going to involve only one style of quotes it's much simpler just to prevent escape characters and march on with the contradicting style for opening and closing the statement.
Mustywindows.com! - Funny Videos, Images, Audio, and Flash! Come submit your own with the newly coded portals!
<?php // php is cool // but Doofy is cooler ?>
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users