Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem ze skryptem, php,
Zakar
post 7.09.2012, 19:06:06
Post #1





Grupa: Zarejestrowani
Postów: 13
Pomógł: 1
Dołączył: 7.09.2012

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


Witam, może mi ktoś powiedzieć, dlaczego ten skrypt
  1. <?php
  2. $imiona = explode("\n", file_get_contents('im.txt'));
  3. foreach ($imiona as $urll)
  4. {
  5. $url = "http://xxxxx=$urllxxxxxxxx";
  6. $fp = fopen($url, "r")
  7. or die("chj");
  8. $page_content = "";
  9. while ($new_text = fread($fp, 6000))
  10. {
  11. $page_content .= $new_text;
  12. }
  13. $match_result =
  14. preg_match_all('/(\d\d\d\d\d\d\d\d\d)/i',
  15. $page_content,
  16. $match_array,
  17. PREG_SET_ORDER
  18. );
  19. foreach ($match_array as $entry)
  20. {
  21. $href = "http://zzzzzzz=$entry[1]";
  22. $fp1 = fopen($href, "r")
  23. or die("chj");
  24. $page_content1 = "";
  25. while ($new_text1 = fread($fp1, 6000))
  26. {
  27. $page_content1 .= $new_text1;
  28. }
  29. $wynik =
  30. preg_match_all("/\d\d\d\s+\d\d\s+\d\d\d/i",
  31. $page_content1,
  32. $wyniko,
  33. PREG_SET_ORDER
  34. );
  35. foreach ($wyniko as $entry1)
  36. {
  37. $href1 = $entry1[0];
  38. print("$href1<br>");
  39. }
  40. }
  41. }
  42.  
  43. ?>


Zwraca mi wyniki podwójnie? Wyświetla te numery w formacie ddd dd ddd, potem wyświetla <br> ale wyświetla te numery po dwa. Ktoś wie co zrobić, żeby były pojedyncze? Od razu podkreślam, na danej stronie jest ten numer tylko RAZ w kodzie źródłowym.

PS. Witam jako nowy uzytkownik na forum:] Jak cos zle z tematem, to prosze napisac, porawie:)
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 Wersja Lo-Fi Aktualny czas: 18.06.2025 - 15:56