Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Wyrażenie Regularne!, preg_match_all
Rafael6666
post
Post #1





Grupa: Zarejestrowani
Postów: 95
Pomógł: 0
Dołączył: 20.10.2006

Ostrzeżenie: (10%)
X----


Załóżmy, że mam taki tekst:

<a ABC> <a ABC1> <a ABC2> <a ABC3>

Jeżeli zrobię coś takiego:
  1. <?php
  2. $tekst = '<a ABC> <a ABC1> <a ABC2> <a ABC3>';
  3. preg_match_all('#<a ABC(.+?)>#i', $tekst, $tablica);
  4. ?>


to $tablica będzie wyglądała tak:

Kod
Array ( [0] => Array ( [0] =>   [1] =>  [2] =>  ) [1] => Array ( [0] => >  2 [2] => 3 ) )


Co zrobić, aby $tablica wyglądała tak:

Kod
Array ( [0] => Array ( [0] =>  [1] =>  [2] =>  [3] =>  ) [1] => Array ( [0] =>  [1] => 1 [2] => 2 [3] => 3 )


Jeżeli da się to zrobić to proszę o pomoc smile.gif ...

Pozdrawiam

Ten post edytował siemakuba 9.08.2007, 14:31:30
Powód edycji: poprawka bbcode


--------------------
Kompleksowe i profesjonalne tworzenie stron www
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 Aktualny czas: 21.08.2025 - 10:35