Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]preg_match wiele wartości
neo1986kk
post 4.06.2011, 00:46:52
Post #1





Grupa: Zarejestrowani
Postów: 561
Pomógł: 3
Dołączył: 2.02.2009

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


Witam mam takie pytanie bardziej tylko z ciekawości.

Jak to jest żę

  1. <?php
  2.  
  3. $url = "http://www.youtube.com/watch?v=LMZroFpNQ4o";
  4.  
  5. $page = file_get_contents($url);
  6.  
  7. preg_match_all("/\/watch\?v=(.*?)[&\"]/i", $page, $matches);
  8. $id_array = $matches[1];
  9. print_r($id_array);
  10.  


wyświetla wiele wartości, chodzi mi o to jak to jest zrobione, dlatego ze idąc tym tropem to chyba pod jenym kodem można zapisać wiele parametrów...
Tak mi się wydaje, tylko nie rozumiem właśnie skąd to się bierze, ale to dlatego że nie rozumiem samego preg_match
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
neo1986kk
post 4.06.2011, 14:23:30
Post #2





Grupa: Zarejestrowani
Postów: 561
Pomógł: 3
Dołączył: 2.02.2009

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


  1. Array
  2. (
  3. [0] => Array
  4. (
  5. [v] => LMZroFpNQ4o
  6. )
  7.  
  8. [1] => Array
  9. (
  10. [v] => RpRH6PgJarw
  11. [feature] => fvwrel
  12. )
  13.  
  14. [2] => Array
  15. (
  16. [v] => 3bMkSprca24
  17. [feature] => list_related
  18. [playnext] => 1
  19. [list] => SP0848589BB0CF8B3C
  20. )
  21.  
  22. [3] => Array
  23. (
  24. [v] => _3GL4_bGjwA
  25. [feature] => relmfu
  26. )
  27.  
  28. [4] => Array
  29. (
  30. [v] => LM1R_rhWoX0
  31. [feature] => relmfu
  32. )
  33.  
  34. [5] => Array
  35. (
  36. [v] => 2a6XAgUsmj0
  37. [feature] => relmfu
  38. )
  39.  
  40. [6] => Array
  41. (
  42. [v] => u-MvAoMrRfM
  43. [feature] => relmfu
  44. )
  45.  
  46. [7] => Array
  47. (
  48. [v] => XbWTv67zZGM
  49. [feature] => related
  50. )
  51.  
  52. [8] => Array
  53. (
  54. [v] => QgImqENTHg4
  55. [feature] => related
  56. )
  57.  
  58. [9] => Array
  59. (
  60. [v] => dLNaG1ochbY
  61. [feature] => related
  62. )
  63.  
  64. [10] => Array
  65. (
  66. [v] => pBhdGV_rizI
  67. [feature] => related
  68. )
  69.  
  70. [11] => Array
  71. (
  72. [v] => 1LliZIima7E
  73. [feature] => related
  74. )
  75.  
  76. [12] => Array
  77. (
  78. [v] => 1qTFOHqpqK8
  79. [feature] => related
  80. )
  81.  
  82. [13] => Array
  83. (
  84. [v] => hq5NIwqcwrw
  85. [feature] => related
  86. )
  87.  
  88. [14] => Array
  89. (
  90. [v] => SfVwhatXG4I
  91. [feature] => related
  92. )
  93.  
  94. [15] => Array
  95. (
  96. [v] => OVWS0IRFfuw
  97. [feature] => related
  98. )
  99.  
  100. [16] => Array
  101. (
  102. [v] => kO8sZLUnfp8
  103. [feature] => related
  104. )
  105.  
  106. [17] => Array
  107. (
  108. [v] => 3vfVOJaZw4M
  109. [feature] => related
  110. )
  111.  
  112. [18] => Array
  113. (
  114. [v] => y7ZEVA5dy-Y
  115. [feature] => related
  116. )
  117.  
  118. [19] => Array
  119. (
  120. [v] => O6foVpfj9ow
  121. [feature] => related
  122. )
  123.  
  124. [20] => Array
  125. (
  126. [v] => 89nD9XG_tCw
  127. [feature] => related
  128. )
  129.  
  130. [21] => Array
  131. (
  132. [v] => aa2Qvj4G8uY
  133. [feature] => related
  134. )
  135.  
  136. )


hehe no fajnie wyszło, tylko dobrze by było wiedzieć co to wszystko oznacza

z tego co widze to są poprsostu filmy podobne do tego którego adres pobieramy

Ten post edytował neo1986kk 4.06.2011, 14:25:56
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: 14.08.2025 - 17:55