Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Jak to zapisać do pliku?
D3vilroot
post
Post #1





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 5.08.2006

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


Pytanie może wydawać się proste. Jak zapisać wynik kilku operacji w php do pliku.
Odrazu powiem, że wiem jak zapisywać i otwierać pliki smile.gif
Taki mam kod (fregment):
  1. <?php
  2. for($i=0, $a=; $i < 20; $i++ ) 
  3. {
  4. $arrFile[$i] = eregi_replace("nr", "", $arrFile[$i]);
  5. $arrFile[$i] = eregi_replace("rn", "", $arrFile[$i]);
  6. echo  "<b>$nr[$a] $slowo </b>$arrFile[$i]<b> $nr[$a] $slowo</b><a/> ";
  7. $a++;
  8. $i++;
  9. echo  "$arrFile[$i] <strong><u>$nr[$a] $slowo</u></strong><br>";
  10.  
  11.  
  12. }
  13. ?>

Jak zrobić żeby wynik tej pętli, która zwraca mi tekst, zapisać do pliku? A może do jakieś zmiennej się da? worriedsmiley.gif

Ten post edytował D3vilroot 24.10.2006, 15:50:11
Go to the top of the page
+Quote Post
ave
post
Post #2





Grupa: Zarejestrowani
Postów: 117
Pomógł: 2
Dołączył: 29.01.2004
Skąd: Rz-ów

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


  1. <?php
  2. for($i=0, $a=; $i < 20; $i++ ) 
  3. {
  4. $arrFile[$i] = eregi_replace("nr", "", $arrFile[$i]);
  5. $arrFile[$i] = eregi_replace("rn", "", $arrFile[$i]);
  6. $ble.=  "<b>$nr[$a] $slowo </b>$arrFile[$i]<b> $nr[$a] $slowo</b><a/> ";
  7. $a++;
  8. $i++;
  9. $ble.=  "$arrFile[$i] <strong><u>$nr[$a] $slowo</u></strong><br>";
  10.  
  11.  
  12. }
  13. //otworz plik i zapisz do niego zmienna $ble
  14. ?>
Go to the top of the page
+Quote Post
D3vilroot
post
Post #3





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 5.08.2006

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


No tak biggrin.gif przecież to takie proste
Sory za niepotrzebny temat tongue.gif
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 Aktualny czas: 20.08.2025 - 07:29