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? Link to comment https://forums.phpfreaks.com/topic/42996-solved-printing/ Share on other sites More sharing options...
per1os Posted March 16, 2007 Share Posted March 16, 2007 <?php print '$'; ?> Link to comment https://forums.phpfreaks.com/topic/42996-solved-printing/#findComment-208820 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 Link to comment https://forums.phpfreaks.com/topic/42996-solved-printing/#findComment-208826 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 "\$"; Link to comment https://forums.phpfreaks.com/topic/42996-solved-printing/#findComment-208832 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. Link to comment https://forums.phpfreaks.com/topic/42996-solved-printing/#findComment-208839 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.