Administrators Nathan Posted February 23, 2012 Administrators 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>"; ?>
Pete T Posted February 23, 2012 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 Nathan and haye55987 2
Administrators Nathan Posted February 23, 2012 Author Administrators Posted February 23, 2012 Thanks guys.
Recommended Posts