Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] ze stringu do tablicy podzial na linie
-gox-
post
Post #1





Goście







Jak najlepiej podzielic strong na kolejne elementy tablicy?

explode, ale nie wiem czy bedzie \r\n czy \n, wiec musialbym wczesniej dac str_replace(\r\n, \n);

fgets() na stringu sie nie da..

file() tez sie nie da (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)

Macie jakies ciekawe pomysly?
Go to the top of the page
+Quote Post
.radex
post
Post #2





Grupa: Zarejestrowani
Postów: 1 657
Pomógł: 125
Dołączył: 29.04.2006

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


  1. <?php
  2. $string = ' (...) ';
  3.  
  4. $string = str_replace(array("r", "r\n"), "\n"), $string);
  5.  
  6. $string = explode("\n", $string);
  7. ?>
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 14.09.2025 - 23:59