Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Polskie znaki w pliku php, dodalem deklaracje polskich znakow i nic z tego
uczaj21
post
Post #1





Grupa: Zarejestrowani
Postów: 115
Pomógł: 0
Dołączył: 30.06.2007

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


Witam mam dziwny problem z kodowaniem polskich znakow.Najgorsze w tym ze deklaruje polskie znaki w meta.Jest to skrypcik losowych cytatow z pliku txt.Na przegladarce nie wyswietlaja mi sie polskie zanki albo wyswietlaja sie niektore polskie na ż a ą juz nie itp.Prosze o pomoc Zamieszczam kod ponizej dodam iz plik ma format php a nie html

  1. <html>
  2. <head>
  3. <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2" />
  4. <meta http-equiv="Pragma" content="no-cache" />
  5. <meta name="Author" content="Łukasz Stolarski" />
  6. <meta name="Authoring_tool" content="PHP Webpage Editor" />
  7.  
  8. </head>
  9. <?
  10.  // Quick random quote
  11.  // This script reads a quote file (flat text file), and picks one of the loaded
  12.  // quotes at random and displays it.
  13.  // Line breaks and formatting can be put into the quotefile as HTML tags
  14.  // Place the quotes.txt on your site, edit the $quotefile variable below,
  15.  // And copy and paste this code into your PHP page.
  16.  
  17.  // $delim tells this script what delimits the quotes (default is a CR/LF)
  18.  $delim = "\n";
  19.  
  20.  // $wuotefile points to the file that holds the actual quotes
  21.  $quotefile = "quotes.txt";
  22.  
  23.  $fp = fopen($quotefile, "r");
  24.  $contents = fread($fp, filesize($quotefile));
  25.  $quote_arr = explode($delim,$contents);
  26.  fclose($fp);
  27.  srand((double)microtime()*1000000);
  28.  $quote_index = (rand(1, sizeof($quote_arr)) - 1);
  29.  $herequote = $quote_arr[$quote_index];
  30.  echo $herequote;
  31. ?>
  32. </html>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
tikky
post
Post #2





Grupa: Zarejestrowani
Postów: 112
Pomógł: 1
Dołączył: 2.10.2007

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


Coś chyba robisz źle.

Spróbuj otworzyć dokument w Notepad++, przejdź do menu 'Format' i wybierz 'Convert to UTF-8'

Później posprawdzaj w dokumencie czy widzisz polskie litery.

Sprawdź także czy na początku dokumentu nie masz jakichś dziwnych "krzaków" dodanch przez inny edytor, jak tak to wywal.
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: 14.10.2025 - 09:54