Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Zastapienie while inna funkcja dla jednego wyniku
JamalBIG
post
Post #1





Grupa: Zarejestrowani
Postów: 496
Pomógł: 1
Dołączył: 16.01.2008
Skąd: Świnoujście

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


Witam

Czym moge zastapic funkcje while dla tego kodu tak aby otrzymac tylko jeden wynik?

  1. <?php
  2. if ($handle = opendir('images/Ads/'.$uniqfolder.'')) {
  3.            while (false !== ($file = readdir($handle))) {
  4.                if ($file != "." && $file != "..") {
  5.                    if ((substr($file, -7) == '__2.jpg') OR (substr($file, -8) == '__2.jpeg') OR (substr($file, -7) == '__2.gif') OR (substr($file, -7) == '__2.png')) {
  6.                echo "$file";
  7.                    }
  8.                    }
  9.                }
  10.              closedir($handle);
  11.            }
  12. ?>


Pozdrawiam
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 - 11:28