Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Preg_match
spayk
post
Post #1





Grupa: Zarejestrowani
Postów: 364
Pomógł: 3
Dołączył: 29.11.2008

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


Jak będize wyglądało wyrażenie preg_match_all które z kodu strony wyciągnie
  1. <a href=\'PlayerView.php?playerId=4826200\' class=small_link target=\'_blank\'>


Musi wyciągnąć 4826200

Takich linków z kodzie jest dużo

Z góry dzięki
Go to the top of the page
+Quote Post
djgarsi
post
Post #2





Grupa: Zarejestrowani
Postów: 459
Pomógł: 26
Dołączył: 1.06.2009

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


  1. preg_match_all('#<a href=\'PlayerView.php?playerId=(.+?)\' class=small_link target=\'_blank\'>#is', $input, $output);


Spróbuj tego.
Go to the top of the page
+Quote Post
reptile_rex
post
Post #3





Grupa: Zarejestrowani
Postów: 24
Pomógł: 2
Dołączył: 8.06.2007

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


Nie podam ci gotowca, ale podam znakomite narzędzie, które ułatwi ci rozwiązywanie takich problemów:

http://gskinner.com/RegExr/

Pozdrawiam serdecznie
Go to the top of the page
+Quote Post
spayk
post
Post #4





Grupa: Zarejestrowani
Postów: 364
Pomógł: 3
Dołączył: 29.11.2008

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


zwraca pustą tablice (IMG:style_emoticons/default/tongue.gif)


http://gskinner.com/RegExr/?33kp8

Ten post edytował spayk 2.02.2013, 16:03:51
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 08:40