caute
\n mi nejde
napriklad print alebo echo "\n" spravi akurat tak medzeru
skusal som mamp inak mam xampp
php 7 a 8
firefox aj chrome
" aj '
editor mam vscode
nejde novy riadok v php
- JurajSlovakID
- Používateľ
- Príspevky: 838
- Dátum registrácie: Po 13. Apr, 2015, 09:35
- Bydlisko: Spišská Nová Ves
nejde novy riadok v php
PC: CPU: RYZEN 5950X VMR-B2@ 4725MHz 1.35V , Chladic Arctic Liquid Freezer II RAM: GSKILL NEO 2x16KIT(32GB) 14-15-15-12-26-38 CR2 - upravene tercialne casovania, GFX: AMD Vega64, MB: Asus Dark Hero VIII X570, M.2 SSD Samsung 990 PRO 2TB, 2xRAID1 WDGOLD 8TB
- Jednoduska
- Sponzor fóra silver
- Príspevky: 6037
- Dátum registrácie: Po 19. Nov, 2012, 15:45
- Bydlisko: Kosice, 040 01
Re: nejde novy riadok v php
prvy vysledok v google na stackoverflow si pozeral? respektive prvu stranu?
je toho celkom dost online.

- JurajSlovakID
- Používateľ
- Príspevky: 838
- Dátum registrácie: Po 13. Apr, 2015, 09:35
- Bydlisko: Spišská Nová Ves
Re: nejde novy riadok v php
"\n";
echo "sometext";
echo "\n";
chr(0x0A);
echo 'text
nexttext';
echo "other text";
urobi,
sometext text nexttextother text
echo "sometext";
echo "\n";
chr(0x0A);
echo 'text
nexttext';
echo "other text";
urobi,
sometext text nexttextother text
PC: CPU: RYZEN 5950X VMR-B2@ 4725MHz 1.35V , Chladic Arctic Liquid Freezer II RAM: GSKILL NEO 2x16KIT(32GB) 14-15-15-12-26-38 CR2 - upravene tercialne casovania, GFX: AMD Vega64, MB: Asus Dark Hero VIII X570, M.2 SSD Samsung 990 PRO 2TB, 2xRAID1 WDGOLD 8TB
- Jednoduska
- Sponzor fóra silver
- Príspevky: 6037
- Dátum registrácie: Po 19. Nov, 2012, 15:45
- Bydlisko: Kosice, 040 01
Re: nejde novy riadok v php
Opakujem, prvy vysledok z googlu 
When you run a PHP script in a browser, it will be rendered as HTML by default. If the books you’re using show otherwise, then either the code or the illustration is inaccurate. You can use “view source” to view what was sent to the browser and you’ll see that your line feeds are present.
<?php
echo "Line 1\nLine 2";
?>
This will render in your browser as:
Line 1 Line 2
If you need to send plain text to your browser, you can use something like:
<?php
header('Content-type: text/plain');
echo "Line 1\nLine 2";
?>
This will output:
Line 1
Line 2
PHP Linefeeds (\n) Not Working is referring to sending output to a file rather than the browser.

When you run a PHP script in a browser, it will be rendered as HTML by default. If the books you’re using show otherwise, then either the code or the illustration is inaccurate. You can use “view source” to view what was sent to the browser and you’ll see that your line feeds are present.
<?php
echo "Line 1\nLine 2";
?>
This will render in your browser as:
Line 1 Line 2
If you need to send plain text to your browser, you can use something like:
<?php
header('Content-type: text/plain');
echo "Line 1\nLine 2";
?>
This will output:
Line 1
Line 2
PHP Linefeeds (\n) Not Working is referring to sending output to a file rather than the browser.