Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Nie działa język w funkcjach
Emrys
post
Post #1





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 1.01.2016

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


Witam.
Przejdę do rzeczy. Zrobiłem sobie mini system języków.
  1. if($language == 'polish' || $language == 'english')
  2. require_once('lang/'.$language.'.php');

  1. $lng['home'] = 'Homepage';
  2. $lng['main'] = 'Main';
  3. $lng['forum'] = 'Forums';

W sumie nie w tym jest problem, bo to ładnie działa.
Problem mam taki, że w funkcjach gdy chce wyświetlić np.
  1. $lng['main']

nic się nie wyświetla tylko pozostaje puste miejsce.

Przykładowa funkcja, która wyświetla mi informacje:
  1. function info($info) {
  2. header("Refresh: 2; url=".$_SERVER['HTTP_REFERER']);
  3. echo '<title>TheOtherSide.pl | '.$lng['info'].'</title>';
  4. echo '<div class="thead">'.$lng['info'].'</div><div class="center" align="center">'.$info.'</div>';
  5. }


Bardzo proszę o pomoc. Mam nadzieje, że napisałem w dobrym dziale, bo to raczej przedszkole ;P
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
com
post
Post #2





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

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


global na całą tablice (IMG:style_emoticons/default/smile.gif)

Przykład

http://ideone.com/T7kDQ1

Ten post edytował com 1.01.2016, 19:29:38
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: 16.09.2025 - 19:36