Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]PHP upakowane kodu w funkcje
Forum PHP.pl > Forum > Przedszkole
marek83
Witam
Mam problem z upakowaniem kawałków kodu w funkcje

pierwsza funkcja
  1. preg_match_all('/farm="(\d)" /',$xml,$farm);
  2. preg_match_all('/server="(.*?)" /',$xml,$server);
  3. preg_match_all('/id="(.*?)" /',$xml,$id);
  4. preg_match_all('/secret="(.*?)" /',$xml,$secret);


druga funkcja
  1. for ($i=0;$i<10;$i++) {
  2. preg_match('/farm="(\d)"/',$farm[0][$i],$farm2);
  3. preg_match('/server="(.*?)"/',$server[0][$i],$server2);
  4. preg_match('/id="(.*?)"/',$id[0][$i],$id2);
  5. preg_match('/secret="(.*?)"/',$secret[0][$i],$secret2);
  6. preg_match('/title="(.*?)"/',$title[0][$i],$title2);
  7. $arr[]= "http://farm$farm2[1].staticflickr.com/$server2[1]/$id2[1]_$secret2[1].jpg";
  8. $photo ="<img src=\"http://farm$farm2[1].staticflickr.com/$server2[1]/$id2[1]_$secret2[1].jpg\" />";
  9.  
  10.  
  11.  
  12.  
  13. }
!*!
I gdzie ta funkcja?
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.