Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zamiana polskich znaków
grzegorz-gg
post
Post #1





Grupa: Zarejestrowani
Postów: 94
Pomógł: 0
Dołączył: 25.12.2004

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


Czy jest jakaś funkcja która zmienia polskie znaki np. ą na a, ł na l, itd. ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
erix
post
Post #2





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Tylko zapisz plik z funkcja w odpowiednim kodowaniu.
  1. <?php
  2. function stripPlChars($string){
  3. $string = str_replace('ą', 'a', $string);
  4. $string = str_replace('Ą', 'A', $string);
  5. $string = str_replace('ć', 'c', $string);
  6. $string = str_replace('ę', 'e', $string);
  7. $string = str_replace('Ę', 'ę', $string);
  8. $string = str_replace('ł', 'l', $string);
  9. $string = str_replace('Ł', 'ł', $string);
  10. $string = str_replace('ń', 'n', $string);
  11. $string = str_replace('Ń', 'N', $string);
  12. $string = str_replace('ó', 'ó', $string);
  13. $string = str_replace('Ó', 'O', $string);
  14. $string = str_replace('ś', 's', $string);
  15. $string = str_replace('Ś', 'S', $string);
  16. $string = str_replace('ź', 'z', $string);
  17. $string = str_replace('Ź', 'Z', $string);
  18. $string = str_replace('ż', 'z', $string);
  19. $string = str_replace('Ż', 'Z', $string);
  20. return $string;
  21. }
  22. ?>
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: 29.09.2025 - 12:10