lifeson2112 Posted March 16, 2007 Share Posted March 16, 2007 Hello, I am writing a php program and I need to print out the $ character. Does anyone know how to do this? Quote Link to comment Share on other sites More sharing options...
per1os Posted March 16, 2007 Share Posted March 16, 2007 <?php print '$'; ?> Quote Link to comment Share on other sites More sharing options...
christophe Posted March 16, 2007 Share Posted March 16, 2007 Heres one way if i read your post correctly echo "$"; if you want to print a variable Print $variablename; Regards Alex Quote Link to comment Share on other sites More sharing options...
Psycho Posted March 16, 2007 Share Posted March 16, 2007 To give more of an explanation, if you use double quotes then PHP attempts to parse variables in the string. With single quotes it does not attempt to parse variables. You can use double quotes, but you would need to escape the dollar sign: print "\$"; Quote Link to comment Share on other sites More sharing options...
lifeson2112 Posted March 16, 2007 Author Share Posted March 16, 2007 Sweet. Both the single quotes and the escape characters are working great. Quote Link to comment 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.