Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Preg match diva
Watt
post
Post #1





Grupa: Zarejestrowani
Postów: 372
Pomógł: 1
Dołączył: 13.06.2008

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


Witam,

Mam diva i chciałbym z niego wyciągnąć treść:

Kod
<div style="" dir="ltr"> costam </div>

więc napisałem kod
  1. preg_match_all("/<div style=\"\" dir=\"ltr\"[^>]*>(.*?)<\/div>/",$result ,$matches);


Lecz on nie chce działać - co zrobiłem źle?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Pawel_W
post
Post #2





Grupa: Zarejestrowani
Postów: 1 675
Pomógł: 286
Dołączył: 15.06.2009
Skąd: Wieliczka

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


no to było tak od razu... (IMG:style_emoticons/default/smile.gif)
  1. preg_match('#<input type=hidden name=gtrans value="(.*)"><div id=sug_exp>#',$result,$matches);
  2. echo $matches[1];

o to chodziło?
Go to the top of the page
+Quote Post

Posty w temacie


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: 2.10.2025 - 22:09