Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

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





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

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


taki kod
  1. <?php
  2. $str='1aaa2zzzzz1aaaa2';
  3.  
  4. eregi('1a+2', $str, $a);
  5. print_r($a);
  6. ?>


wyświetla mi
Kod
Array (     [0] => 1aaa2 )



a taki kod
  1. <?php
  2. $str='1aaa2zzzzz1aaaa2';
  3.  
  4. preg_match('1a+2', $str, $a);
  5. print_r($a);
  6. ?>


wyswietla mi
Kod
[b]Warning[/b]:  preg_match() [[url="http://peter13135.xaa.pl/serials%20beta/function.preg-match"]function.preg-match[/url]]: Delimiter must not be alphanumeric or backslash


a chciałbym by ta tablica wyglądała w ten sposób
( [0] => 1aaa2 )
Array ( [1] => 1aaaa2 )
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
mike
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

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


Zamykam za crossposting.
Następnym razem będzie ostrzeżenie.
Go to the top of the page
+Quote Post

Closed 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 - 00:51