t3kizzleee Posted January 15, 2010 Share Posted January 15, 2010 Hello, I'm not a PHP coder but I am having trouble echoing something simple. I want to echo "<br/>" I've tried it so many times but cannot get it to print out what I want. Link to comment https://forums.phpfreaks.com/topic/188535-need-simple-echo-help/ Share on other sites More sharing options...
mapleleaf Posted January 15, 2010 Share Posted January 15, 2010 maybe because a line break is nothing to see. did you try: echo 'hello<br>world'; Link to comment https://forums.phpfreaks.com/topic/188535-need-simple-echo-help/#findComment-995352 Share on other sites More sharing options...
J-C Posted January 15, 2010 Share Posted January 15, 2010 You can still out put a line break but you need to do it like this echo '<br>'; Link to comment https://forums.phpfreaks.com/topic/188535-need-simple-echo-help/#findComment-995367 Share on other sites More sharing options...
x_filed2k Posted January 15, 2010 Share Posted January 15, 2010 I am not sure on what you are trying to do? Are you trying to print on a web browser an html tags.. if do so you need to use a function: echo(htmlentities("<br />", ENT_QUOTES)); But if you would like to <br /> only, of course you're not going to see it, coz it is a html tag, you can see it if you view source, . Link to comment https://forums.phpfreaks.com/topic/188535-need-simple-echo-help/#findComment-995372 Share on other sites More sharing options...
J-C Posted January 15, 2010 Share Posted January 15, 2010 I am not sure on what you are trying to do? Are you trying to print on a web browser an html tags.. if do so you need to use a function: echo(htmlentities("<br />", ENT_QUOTES)); But if you would like to <br /> only, of course you're not going to see it, coz it is a html tag, you can see it if you view source, . LOL i actually didn't think he wanted to output an ACTUAL "<br />" xD i guess that would make more sense why he can't get it working Link to comment https://forums.phpfreaks.com/topic/188535-need-simple-echo-help/#findComment-995373 Share on other sites More sharing options...
t3kizzleee Posted January 15, 2010 Author Share Posted January 15, 2010 I don't want to print the line break. I know that it is a BR tag. I want to print the specific characters "<br/>" EDIT: The htmlentities worked for me. Thank you so much. I was trying to do with with a \ to negate the < in the tag but it wouldn't work and it got me really frustrated. Thanks. Link to comment https://forums.phpfreaks.com/topic/188535-need-simple-echo-help/#findComment-995374 Share on other sites More sharing options...
J-C Posted January 15, 2010 Share Posted January 15, 2010 OH lol well you can do as suggested above or you can do this echo ' <br /> '; lol i know is really gay but it works xD Link to comment https://forums.phpfreaks.com/topic/188535-need-simple-echo-help/#findComment-995376 Share on other sites More sharing options...
x_filed2k Posted January 15, 2010 Share Posted January 15, 2010 Hehe. Yeah, but it is a better practice to use htmlentities("<br />", ENT_QUOTES); Link to comment https://forums.phpfreaks.com/topic/188535-need-simple-echo-help/#findComment-995386 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.