echo href?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jamiee
Forum Newbie
Posts: 1
Joined: Sun Dec 27, 2009 1:40 pm

echo href?

Post by Jamiee »

Hey guys.

Completely new to PHP and MySQL.

Was wondering if you knew how to generate a href in PHP...
Probably the stupidest question going but still important to me :)

So in raw HTML form:

Code: Select all

<a href="example.php>Click</a>
How would i translate that to functioning php?

Here's what i have now...

Code: Select all

echo "<a href="upload/">Upload More.</a>"';'
Thanks in advance!
Regards,
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: echo href?

Post by omniuni »

Tip: Using single-quotes you can use double-quotes in your statement:

Code: Select all

<?php echo '<a href="example.php">Click</a>';?>
Otherwise, you need BACKslashes, not forward slashes.

Code: Select all

<?php echo "<a href=\"example.php\">Click</a>";?>
Post Reply