Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Wyrażenia regularne] Wyciąga tylko jedno pole, a nie więcej
Babcia@Stefa
post 27.11.2009, 20:55:58
Post #1





Grupa: Zarejestrowani
Postów: 654
Pomógł: 17
Dołączył: 19.03.2006
Skąd: z kosmosu ;)

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


Witam, mam problem z wyrażeniami regularnymi a mianowicie mam dane:

Kod
><input type="password" name="sudo_password"/>    <input type="password" name="sudo_confirm"/>    <input type="text" name="asd"/>


Kod PHP do wyciągania danych:
  1. preg_match_all( "/<input.*type=\"(text|button|checkbox|radio|password)\".*name=\"(.*)\".*>/" , $Value[3] , $Inputs[ $Key ] , PREG_SET_ORDER );


Wynik:
Kod
Array
(
    [0] => Array
        (
            [0] => <input type="password" name="sudo_password"/>    <input type="password" name="sudo_confirm"/>    <input type="text" name="asd"/>
            [1] => text
            [2] => asd
        )

)


Ale ja oczekuję innego wyniku, a mianowicie:
Kod
Array
(
    [0] => Array
        (
            [0] => <input type="password" name="sudo_password"/>
            [1] => text
            [2] => asd
        )

     [1] => Array
        (
            [0] => <input type="password" name="sudo_confirm"/>
            [1] => password
            [2] => sudo_confirm
        )

      [2] => Array
        (
            [0] => <input type="text" name="asd"/>
            [1] => password
            [2] => asd
        )
)


Proszę o pomoc, nie mogę znaleźć błędu w wyrażeniu.

-- WebNuLL


--------------------
Środowisko testowe (desktop) - Gedit, lighttpd, sftp, rsync, xfce4-terminal, chromium, firefox4 | System: Gentoo ~x86
O'Neill - serwer WWW @ lighttpd, links, nano, rsyncd, sftpd | System: Debian
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: 19.07.2025 - 16:11