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
asterinex
Forum Commoner
Posts: 52 Joined: Thu Nov 25, 2004 7:01 am
Location: Belgium
Post
by asterinex » Tue Jan 04, 2005 3:43 am
Hello,
I want to write a PHP function that echo´s a string with a " in it. How can Print a " in PHP without ending the string ? I hope I made myself clear
Code: Select all
function PHP_Print_Link ($name)
{
$link = "<a href="javascript:popup('50','200','frame_guestbook.php?name=$name');" >$name </a>";
echo $link;
}
Already Thanks,
tylerdurden
Forum Commoner
Posts: 66 Joined: Mon Jul 28, 2003 11:52 am
Location: Austria
Post
by tylerdurden » Tue Jan 04, 2005 4:37 am
Usually you simply escape the "s in the string with \ like so:
Code: Select all
$link = "<a href="javascript:popup('50','200','frame_guestbook.php?name=$name');" >$name </a>";
asterinex
Forum Commoner
Posts: 52 Joined: Thu Nov 25, 2004 7:01 am
Location: Belgium
Post
by asterinex » Tue Jan 04, 2005 6:39 am
Thanks a lot