Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] wyrażenia regularne
peter13135
post
Post #1





Grupa: Zarejestrowani
Postów: 1 447
Pomógł: 191
Dołączył: 26.03.2008

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


mam taki string

  1. $string= 'dsfdsff [cos]lala[/cos] bleble [/cos]blabla[/cos] dsdfsdsffds';


w jaki sposób mogę za pomocą bbcode "wyjąć" teksty (podciągi?) z tego stringu spomiędzy tagów [cos] i [/cos]

zrobiłem takie coś
  1. preg_match_all('/\[cos\][[:print:]\s]*\[\/cos\]/', $string, $out);


ale to zwraca mi tablicę z jednym elementem - '[cos]lala[/cos] bleble [/cos]blabla[/cos]'
w jaki sposób mogę osiągnąć tablice z dwoma elementami : '[cos]lala[/cos]' oraz '[/cos]blabla[/cos]' (IMG:style_emoticons/default/questionmark.gif)
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: 24.08.2025 - 13:35