Administrators Nathan Posted February 23, 2012 Administrators Share Posted February 23, 2012 So I'm very new to PHP and trying to learn a few thing. I'm trying to keep all my code standard. What's the correct way to do a line break in PHP? Such as </br> in HTML? This is how I'm currently doing it: <?php echo $data[0]->like_count; print "<p>Thank you for your purchase!</p>"; ?> Link to comment Share on other sites More sharing options...
Pete T Posted February 23, 2012 Share Posted February 23, 2012 If you are using double quotes (") around your body content, you can use n for a line break. However, if you are using single quotes (') around your body, you can simply enter a line. Example (") $body = "Line OnenLine Two"; This would come out as: Line One Line Two Example (') $body = 'Line One Line Two'; This would also come out as: Line One Line Two haye55987 and Nathan 2 Link to comment Share on other sites More sharing options...
fakesky Posted February 23, 2012 Share Posted February 23, 2012 n , just like in C. Link to comment Share on other sites More sharing options...
Administrators Nathan Posted February 23, 2012 Author Administrators Share Posted February 23, 2012 Thanks guys. Link to comment Share on other sites More sharing options...
Recommended Posts