perficut Posted September 1, 2007 Share Posted September 1, 2007 Im modifying some php lines to fit my need. I am creating an email to be sent to registered users after they register. I want to change the color of certain text, as well as provide a link but cant figure out how to do so since the font color tag and href tag require quotes. here is a cut $Body .= "Please make note of your login ID and PASSWORD. The login information is case sensitive so be sure to enter it EXACTLY as it appears."; I want it to read as follows. Please make note of your login ID and PASSWORD. The login information is case sensitive so be sure to enter it EXACTLY as it appears. Also, I would like to provide a link back to the web page. $Body .="To return to the members page click here"; Quote Link to comment https://forums.phpfreaks.com/topic/67524-help-with-php-syntax/ Share on other sites More sharing options...
teng84 Posted September 1, 2007 Share Posted September 1, 2007 if (yourcondion not satisfied )//put you condition here { $style = 'style ="color: #FF0000"'; echo 'return to pluto <a href="#">click here</a>'; } echo 'hi this is <span '.$style.'>teng</span>i havent test this but it should <span '.$style.'>work</span>'; is this what you mean!! Quote Link to comment https://forums.phpfreaks.com/topic/67524-help-with-php-syntax/#findComment-339051 Share on other sites More sharing options...
dsaba Posted September 1, 2007 Share Posted September 1, 2007 two ways to enclose strings in php either with single quotes (') or double quotes (") or the heredoc syntax, see the php docs for strings if part of your string is the same character you're using to enlclose the strings (either a single quote or a double quote, depending on how you enclose the string) you will have to ESCAPE that character so php disregards it, but still writes it as you intended it example: $string = "Hello my name is Bob but they call me the \"Mean Machine\", but just call me Bob"; I put the escape character \ in front of the character that needs escaping where were two double quotes another example: $string = 'Hello I\'m super cool, jeah?'; i escape the single quote in an single quoted enclosed string have fun, google and the php docs are your friend (http://www.php.net) You have much to learn, young padooine! I remember when I was asking this same question long long ago, but now I am answering it :) Quote Link to comment https://forums.phpfreaks.com/topic/67524-help-with-php-syntax/#findComment-339065 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.