Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Zamian polskich znaków
darektbg
post
Post #1





Grupa: Zarejestrowani
Postów: 54
Pomógł: 0
Dołączył: 25.09.2006

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


  1. <?php
  2. $short = htmlentities($_POST['short'], ENT_COMPAT, 'UTF-8');
  3.                    $short = trim($short);
  4.                    $short = addslashes($short);
  5.                    $short = strtolower($short);
  6.                    $short = strip_tags($short);
  7.                    $short = str_replace('ą', 'a', $short);
  8.                    $short = str_replace('ę', 'e', $short);
  9.                    $short = str_replace('ć', 's', $short);
  10.                    $short = str_replace('ż', 'z', $short);
  11.                    $short = str_replace('ź', 'z', $short);
  12.                    $short = str_replace('ś', 's', $short);
  13.                    $short = str_replace('ł', 'l', $short);
  14.                    $short = str_replace('ó', 'o', $short);
  15.                    $short = str_replace(' ', '-', $short);
  16. ?>

Kodowanie ustawione wszędzie na UTF-8. Efektem jednak są krzaki...
$_POST['short']=ąś => $short= ��
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: 24.08.2025 - 13:41