Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Błąd podczas odczytu z pliku?
-raymon-
post
Post #1





Goście







Witam smile.gif
Mam taki kod:
  1. <?php
  2. $tablica=file("wyrazy.txt");
  3. foreach($tablica as $key => $wyraz){
  4. $tresc="czesc";
  5. $fd = fopen("$wyraz.html", 'w');
  6. fwrite($fd, $tresc);
  7. fclose($fd);
  8. }
  9.  
  10. ?>

Ma on utowrzyć pliki html, a nazwy dla nich ma pobrać z pliku tekstowego wyrazy.txt, jednak problem polega na tym że pobiera mi tylko ostatni wyraz w pliku tekstowym, i wyskakuje taki błąd:
Cytat
Warning: fopen(plik-drugi .html) [function.fopen]: failed to open stream: Invalid argument in c:\wamp\test\index.php on line 5
Warning: fwrite(): supplied argument is not a valid stream resource in c:\wamp\test\index.php on line 6
Warning: fclose(): supplied argument is not a valid stream resource in c:\wamp\test\index.php on line 7
Warning: fopen(plik-trzeci.html) [function.fopen]: failed to open stream: No such file or directory in c:\wamp\test\index.php on line 5
Warning: fwrite(): supplied argument is not a valid stream resource in c:\wamp\test\index.php on line 6
Warning: fclose(): supplied argument is not a valid stream resource in c:\wamp\test\index.php on line 7

O co z tym chodzi?
Go to the top of the page
+Quote Post

Posty w temacie


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: 21.08.2025 - 05:25