Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #16821

Re: echo "<br>" wouldn't print a new line

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From "Christoph M. Becker" <cmbecker69@arcor.de>
Newsgroups comp.lang.php
Subject Re: echo "<br>" wouldn't print a new line
Date Mon, 4 Jul 2016 12:19:35 +0200
Organization solani.org
Lines 22
Message-ID <nldd7c$so7$1@solani.org> (permalink)
References <83e11700-3227-43a8-bf36-ab77004976e6@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Trace solani.org 1467627564 29447 eJwFwYkBwCAIA8CVkCfScWwk+4/gXQUWuBOFLJVoP8Ryi0wG91UfSQc2d5Pj3arPvQeBWOcBMbcRlw== (4 Jul 2016 10:19:24 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Mon, 4 Jul 2016 10:19:24 +0000 (UTC)
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1
X-User-ID eJwFwQENADAIAzBL52OD2xkJ/iW8JRSaSlHJ5ZpHhjPuBOZhr3wMdkNpaN/aOFWRk2h+C5kQOA==
In-Reply-To <83e11700-3227-43a8-bf36-ab77004976e6@googlegroups.com>
Cancel-Lock sha1:YRPb/aRbOpQMqUskQdnPsr9wtF8=
X-NNTP-Posting-Host eJwFwYEBwDAEBMCV1D9qHBH2HyF3Bv+8g25OW1u3PtXUU4mJBU10k3oFKT8ADR3J20Nuaj0VtxCd
Xref csiph.com comp.lang.php:16821

Show key headers only | View raw


On 04.07.2016 at 12:06, Alla wrote:

> I am currently learning C programming, and still a newby, but I have also started php.
> I will be grateful for your help.
> 
> I have watched a tutorial for beginners on using some functions, and the author 
> used echo "<br>"; command to print a new line for the next output. I have tried it,
> but it didn't work. What could be the problem?
> 
> […]

> and here is how the output looks on my Termnal - the "first" is not being printed on a new line:

`echo` just prints the arguments it's given.  There's no magic involved.
 `echo <br>` will never print a new line.  Only when that is part of a
HTML document, the browser will display a line break.  What you're
looking for is "\n" or "\r\n" (for Windows, but often not necessary) or
PHP_EOL (platform independent).  Note that the escape sequences \n and
\r are also available in C (printf etc.).

-- 
Christoph M. Becker

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

echo "<br>" wouldn't print a new line Alla <modelling.data@gmail.com> - 2016-07-04 03:06 -0700
  Re: echo "<br>" wouldn't print a new line "R.Wieser" <address@not.available> - 2016-07-04 12:14 +0200
  Re: echo "<br>" wouldn't print a new line "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-07-04 12:19 +0200
    Re: echo "<br>" wouldn't print a new line Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-07-05 21:43 +0200
      Re: echo "<br>" wouldn't print a new line "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-07-06 13:49 +0200
        Re: echo "<br>" wouldn't print a new line Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-07-06 20:57 +0200
  Re: echo "<br>" wouldn't print a new line Alla <modelling.data@gmail.com> - 2016-07-04 09:38 -0700
  Re: echo "<br>" wouldn't print a new line Tim Streater <timstreater@greenbee.net> - 2016-07-04 12:30 +0100
  Re: echo "<br>" wouldn't print a new line Arno Welzel <usenet@arnowelzel.de> - 2016-07-09 17:43 +0200
    Re: echo "<br>" wouldn't print a new line Sebastiaan Kop <sebastiaan@famkop.nl> - 2016-07-24 16:14 +0000
      Re: echo "<br>" wouldn't print a new line Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2016-07-30 14:03 -0400
        Re: echo "<br>" wouldn't print a new line Jivanmukta <jivanmukta@poczta.onet.pl> - 2016-07-30 20:08 +0200
          Re: echo "<br>" wouldn't print a new line Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2016-07-30 17:18 -0400
        Re: echo "<br>" wouldn't print a new line "R.Wieser" <address@not.available> - 2016-07-31 13:28 +0200
          Re: echo "<br>" wouldn't print a new line "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-07-31 15:28 +0200
            Re: echo "<br>" wouldn't print a new line "R.Wieser" <address@not.available> - 2016-07-31 17:38 +0200
              Re: echo "<br>" wouldn't print a new line "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-08-01 14:57 +0200
                Re: echo "<br>" wouldn't print a new line "R.Wieser" <address@not.available> - 2016-08-01 15:18 +0200
      Re: echo "<br>" wouldn't print a new line "J.O. Aho" <user@example.net> - 2016-07-31 08:17 +0200

csiph-web