html - Line break in PHP -


i trying create newline character in foreach loop. after url trying create newline , have "------" between title , content. after there supposed space between next url. have space can't seem line break. when echo "\t" or "\n" in loop nothing happens. when use html in loop won't work, gives many spaces.

for($i=0; $i < 4 ;$i++) { foreach ($json $url)     {         echo $url ['results'][$i]['url'];         echo "---------------";         foreach ($json $title)         {               echo $title ['results'][$i]['title'];               echo "--------";         }         foreach ($json $content)               echo $content['results'][$i]['content'];         echo "---------------- ";     } } 

is there function in php besides "\n" or way of manipulating html insert line break?

tia

there 2 things can do:

1: use <br> line break. if use that, should consider using <hr> insert horizontal line.

some text<br> <hr> other text<br> 

2: use <pre> , </pre> tags around text output preformatted text. can use \n , \t format text.

<pre> text\n -------\n other text\n </pre> 

Comments