Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Wycięcie wszystkich czterocyfrowych liczb ze stringa
mefistofeles
post
Post #1





Grupa: Zarejestrowani
Postów: 255
Pomógł: 0
Dołączył: 23.06.2009

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


  1. $string = 'April 15, 2003';
  2. $pattern = '/([0-9]){4}/';
  3. $replacement = 'rok';
  4.  
  5. preg_replace ( $pattern , $replacement , $string);
  6. echo $string;


Chciałbym zamienić '2003' na 'rok', ale coś z moim wyrażeniem jest nie tak.

Ten post edytował mefistofeles 6.02.2010, 13:42:18
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: 19.08.2025 - 16:31