Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Zamiana bialego znaku
zleceniodawca123
post
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 17.02.2016

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


  1. <?php
  2. function plCharset($string) {
  3.  
  4. $string = strtolower($string);
  5. $source = array('Ą', 'ą', 'Ć', 'ć', 'Ę', 'ę', 'Ł', 'ł', 'Ń', 'ń', 'Ó', 'ó', 'Ś', 'ś', 'Ż', 'ż', 'Ź', 'ź');
  6. $change = array('A', 'a', 'C', 'c', 'E', 'e', 'L', 'l', 'N', 'n', 'O', 'o', 'S', 's', 'Z', 'z', 'Z', 'z');
  7. $string = str_replace($source, $change, $string);
  8. $string = stripslashes($string);
  9. $string = urlencode($string);
  10. print "$string\n";
  11.  
  12. }
  13. $string = " ŃŃŃŃŃÓÓ Óó łłłłł ŁŁŁŁĄĄ\nĄĘĘĘęę ęŚŚŻŹĆźżć";
  14. print "$string\n";
  15. plCharset($string);
  16. ?>


Ten post edytował zleceniodawca123 23.02.2016, 22:21:11
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 - 19:05