PHP Link in echo
I have the echo below and I need to link in it but I get an unexpected T_STRING on that line with the link and it says expecting ',' or ';'
The code is:
echo " You Are Now A 开发者_如何学GoUser Of ClipBoy!
Drag the image below to your bookmarks bar for easy access to your site!
To get to your site go to
<a href"http://themacsplash.com/ClipBoy/userfiles/$myUser" target "_blank">
http://themacsplash.com/ClipBoy/userfiles/$myUser</a>";
How would I fix this?
Escape the double quotes in your string, like this \"
So it becomes:
echo " You Are Now A User Of ClipBoy!
Drag the image below to your bookmarks bar for easy access to your site!
To get to your site go to
<a href=\"http://themacsplash.com/ClipBoy/userfiles/$myUser\" target=\"_blank\">
http://themacsplash.com/ClipBoy/userfiles/$myUser</a>";
You need to escape the "
with \"
You must escape your double quotes
try this :
echo ' You Are Now A User Of ClipBoy! Drag the image below to your bookmarks bar for easy access to your site! To get to your site go to <a href="http://themacsplash.com/ClipBoy/userfiles/'.$myUser.'" target="_blank">http://themacsplash.com/ClipBoy/userfiles/'.$myUser.'</a>';
or :
echo " You Are Now A User Of ClipBoy! Drag the image below to your bookmarks bar for easy access to your site! To get to your site go to <a href=\"http://themacsplash.com/ClipBoy/userfiles/$myUser\" target=\"_blank\">http://themacsplash.com/ClipBoy/userfiles/$myUser</a>";
精彩评论