Page 1 of 1

echo string Problem

Posted: Tue Jan 04, 2005 3:43 am
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,

Posted: Tue Jan 04, 2005 4:37 am
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>";

Posted: Tue Jan 04, 2005 6:39 am
by asterinex
Thanks a lot