echo string Problem

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
asterinex
Forum Commoner
Posts: 52
Joined: Thu Nov 25, 2004 7:01 am
Location: Belgium

echo string Problem

Post by asterinex »

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;
&#125;
Already Thanks,
tylerdurden
Forum Commoner
Posts: 66
Joined: Mon Jul 28, 2003 11:52 am
Location: Austria

Post by tylerdurden »

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 »

Thanks a lot
Post Reply