I have a loop that brings some data down from a MySQL database, but it adds the code on the same line, right next to each other
Is there a way of dropping a line in the code within each loop
Thanks, ILMV
Printable View
I have a loop that brings some data down from a MySQL database, but it adds the code on the same line, right next to each other
Is there a way of dropping a line in the code within each loop
Thanks, ILMV
yes!
Where you want the line to break add ."\n"; to the end of your string.
Failing that try ."<br />";
Worked great, i had seen that used before, never knew what it was.
great work :D
No prob!
Obv. the more line breaks you want just keep adding \n\n etc within the quote ("") marks.
How you implement a new line is completely dependent on the content type of the file being outputted. If you do not specify a content type by default, text/html is assumed which means you must serve a proper HTML document. If you just want to show raw data use the content type text/plain which saves you having to construct an HTML document. To make a line break in a text/plain document use the sequence "\r\n" (CR+LF) for maximum browser compatability.
To specify content type, call the header() function before starting any output.
PHP Code:header('Content-type: text/plain; charset: utf-8');