Quantcast
Channel: Active questions tagged linefeed+php+carriage-return - Stack Overflow
Viewing all articles
Browse latest Browse all 5

In PHP in Windows, do 'linefeed (LF)' and 'carriage return (CR)' mean the same thing? [duplicate]

$
0
0

This question already has an answer here:

I'm using PHP 7.2.10

I'm using Windows 10 Home Single Language 64-bit Operating System

I tried following two codes but I received the same output in both the cases :

Code 1 :

<?php

echo "stackoverflow\nnine" ;

?>

Code 2 :

<?php

echo "stackoverflow\rnine" ;

?>

Same output for both of the above programs :

stackoverflow
nine

As per my knowledge, Linefeed(\n) means to advance downward to the next line and Carriage return(\r) means to return to the beginning of the current line without advancing downward.

Then, why I am getting the same output for the things which are entirely different in nature and in meaning?

Why I'm getting the output with carriage return(\r) on the next line advanced downward?


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>