Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Odczyt z pliku
Mlodycompany
post 17.08.2008, 16:08:31
Post #1





Grupa: Zarejestrowani
Postów: 910
Pomógł: 44
Dołączył: 20.02.2008
Skąd: Łódź

Ostrzeżenie: (20%)
X----


Witam. Mam na stronie regulamin który jest odczytywany z pliku. Odczytuje go za pomocą
  1. <?php
  2. $open = fopen('regulamin.'.$lang.'', 'r');
  3. while(!feof($open)){
  4.   $str = fgets($open);
  5.   $str = str_replace('\n', '<br>', $str);
  6.   $instruct .= $str;
  7. }
  8. ?>


Problem polega na tym, że chcę aby regulamin był dzielony na linijki tak jak w pliku, a na stronie wyświetla w jednej lini. Czy jest jakis sposób aby temu zaradzić??
Go to the top of the page
+Quote Post
Cysiaczek
post 17.08.2008, 16:20:48
Post #2





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




http://pl2.php.net/manual/pl/function.nl2br.php


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
pyro
post 17.08.2008, 16:22:37
Post #3





Grupa: Zarejestrowani
Postów: 2 148
Pomógł: 230
Dołączył: 26.03.2008

Ostrzeżenie: (0%)
-----


lub zamienic '\n' na "\n"


--------------------
ET LINGUA EIUS LOQUETUR IUDICIUM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 6.07.2025 - 07:30