27
   

What does \n mean in PHP Code?

 
 
roger710
 
  1  
Wed 10 Sep, 2014 12:32 am
@roverroad,
\t represents a tab
\n represents a new line
\r represents a carriage return

Hope that clears it up for you!
0 Replies
 
vijaywebsolutions
 
  0  
Tue 28 Oct, 2014 01:59 am
@roverroad,
\n is the newline character, \t is the tab character. It's usually use for formatting html. eg,
echo "<html>\n<head>\n</head>\n<body>\n\t<div>\n\t</div>\n</body>\n</html>";

will look like:

PHP Code:
<html>
<head>
</head>
<body>
<div>
</div>
</body>
</html>
0 Replies
 
saniyapatel
 
  0  
Thu 25 Dec, 2014 04:23 am
@roverroad,
It means break a line.
0 Replies
 
RahulAgrawal
 
  1  
Mon 9 Feb, 2015 04:05 am
@roverroad,
While using this \n, it means what ever you wrote it will show on the next line though it means next line.
0 Replies
 
icajobguarantee
 
  0  
Sat 28 Feb, 2015 06:53 am
@roverroad,
It means new line break
0 Replies
 
hingehead
 
  4  
Sun 1 Mar, 2015 03:23 pm
Two pages of people answering a question answered 9 years ago and not one appears to have thought to read a previous answer. An awesome slow experiment in clueness. I'm leaving this thread to someone in my will.
0 Replies
 
frankC21
 
  -1  
Fri 6 Mar, 2015 11:17 am
@roverroad,
It simply means new line. e.g.
CODE:
echo 'HelloWorld';
echo 'Hello\nWorld';

OUTPUT:
HelloWorld
Hello
World
0 Replies
 
MarinWhite
 
  0  
Tue 10 Mar, 2015 01:35 am
@roverroad,
Hi,
Though the code is working fine but \n is used internally by the compiler to point the new line.
0 Replies
 
jamegriffin
 
  -1  
Sat 10 Oct, 2015 12:44 am
@roverroad,
\n is the newline character, \t is the tab character. It's usually use for formatting html. eg,

echo "<html>\n<head>\n</head>\n<body>\n\t<div>\n\t</div>\n</body>\n</html>";
0 Replies
 
krishnanayak
 
  0  
Wed 27 Jul, 2016 11:53 pm
"\n" It is used for new line or line break in php
hingehead
 
  2  
Thu 28 Jul, 2016 05:48 am
@krishnanayak,
http://able2know.org/topic/71607-2#post-5898266
0 Replies
 
astoncalvin
 
  0  
Fri 21 Apr, 2017 05:14 am
@roverroad,
It is used for new line or line break in PHP.
hingehead
 
  1  
Sun 23 Apr, 2017 07:51 am
@astoncalvin,
http://able2know.org/topic/71607-2#post-5898266
0 Replies
 
jennypitula
 
  1  
Thu 27 Apr, 2017 05:53 am
@roverroad,
\n ,It is used for newline.
For this example I have considered two string named x and y, then assigned value and prinedt it.
$x = 'Hi';
$y = 'Bye';
echo '<p>' . $x . '</p>\n';
echo '<p>' . $y . '</p>';
Output:
Hi
Bye
hingehead
 
  1  
Mon 1 May, 2017 07:46 pm
@jennypitula,
http://able2know.org/topic/71607-2#post-5898266
0 Replies
 
hingehead
 
  1  
Thu 6 Jul, 2017 10:44 pm
http://able2know.org/topic/71607-2#post-5898266
0 Replies
 
nitarayan
 
  1  
Mon 10 Jul, 2017 06:07 am
@roverroad,
Maybe yes
0 Replies
 
 

Related Topics

\n - Question by negikaithal
PHP question about parse_url - Question by markalanbaker1
PHP Debate - Discussion by Craven de Kere
PHP: Cookie Problem - Discussion by BobbyDouglas
Installing PHP with IIS - CGI Error - Discussion by skinnz
Displaying <?php in javascript. - Discussion by BobbyDouglas
php software - Question by aishna
 
Copyright © 2019 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 08/23/2019 at 02:34:16