Jump to content

Help with echo()


transparencia

Recommended Posts

I'm having some problems with this code:

 

echo '
			<A HREF="javascript:void(0)"
onclick="window.open('http://website.net/community/xspf_player.swf?playlist_url=http://website.net/community/playlist.php?u=',$message['member']['id'],'')">
Open a new window</A>';

 

Can anybody help formatting this right?

Link to comment
https://forums.phpfreaks.com/topic/185025-help-with-echo/
Share on other sites

<?php
echo '
            <A HREF="javascript:void(0)"
onclick="window.open(\'http://website.net/community/xspf_player.swf?playlist_url=http://website.net/community/playlist.php?u='.$message['member']['id'].'\');">
Open a new window</A>';
?>

Link to comment
https://forums.phpfreaks.com/topic/185025-help-with-echo/#findComment-976676
Share on other sites

if you enclose it with single quotes you must escape any single quotes within it. If you enclose it in double quotes you must escape any double quotes within it.

 

all these are valid

 

echo " she said, \"yes\" ";

echo ' she said, don\'t ';

 

echo "she said, 'yes' ";

echo "she said, don't ";

 

HTH

Teamatomic

Link to comment
https://forums.phpfreaks.com/topic/185025-help-with-echo/#findComment-976683
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.