Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> strtolower(string) i polskie znaki
grzegorzblodz
post
Post #1





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 31.01.2008

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


Witam, mam problem odnośnie funkcji strtolower()
Działa jak należy dopuki nie trafi na polski znak :/

echo strtolower('AsŁÓŚĆD');

Cytat
asłó�ćd


jest na to jakiś sposób? muszę to jakość przejść bo to mnie blokuje a nie wiem co z tym zrobić (IMG:http://forum.php.pl/style_emoticons/default/sadsmiley02.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
potreb
post
Post #2





Grupa: Zarejestrowani
Postów: 1 568
Pomógł: 192
Dołączył: 7.03.2005
Skąd: Warszawa

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


Grzesiu sprawdź tak, napewno zadziała:
  1. <?php
  2. $mystring = 'ĄŚĆĘĄĄąśęśbc';
  3. $findme  = 'ą';
  4. $pos = strpos(strtolower($mystring), strtolower($findme));
  5.  
  6. // Note our use of ===. Simply == would not work as expected
  7. // because the position of 'a' was the 0th (first) character.
  8. if ($pos === false) {
  9. echo "The string '$findme' was not found in the string '$mystring'";
  10. } else {
  11. echo "The string '$findme' was found in the string '$mystring'";
  12. echo " and exists at position $pos";
  13. }
  14. ?>


Widze że manula się czyta (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Ja zastosowałem utf-8 tak, że w pliku mi poprawnie wyświetla polskie litery.

Ten post edytował potreb 18.02.2008, 17:58:53
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: 4.10.2025 - 13:48