Jump to content

Simple problem,It's not echoing newline


colap

Recommended Posts

The \n isn't interpreted when enclosed in single quotes, use double quotes.

 

This

<?php
echo '\n';
?>

will echo the string \n, while this

<?php
echo "\n";
?>

will produce a newline character.

 

But the newline character isn't seen by the browser as a newline, for that you need to echo the <br> tag.

 

Ken

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.