Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> wyświetla tylko pierwszą literę
batusoo
post
Post #1





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 24.03.2005
Skąd: działdowo

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


mam takie coś
  1. <?php
  2.  
  3. $lang['kupa'] = 'kupa';
  4. ...
  5. echo $lang['kupa']
  6.  
  7. ?>

A w rezultacie pokazuje mi tylko pierwszą literę czyli "k". Jak napisze wartość zmiennej jako 'bla' to wyświetli "b". Co jest nie tak?
Go to the top of the page
+Quote Post
bela
post
Post #2


Administrator PHPedia.pl


Grupa: Developerzy
Postów: 1 102
Pomógł: 2
Dołączył: 14.09.2003

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


A czemu nie masz średnika na końcu ?:]
Go to the top of the page
+Quote Post
ikioloak
post
Post #3





Grupa: Zarejestrowani
Postów: 416
Pomógł: 0
Dołączył: 8.01.2004

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


a moze napiszesz co jest w tych '...' bo bez tego to wszystko dziala.
Go to the top of the page
+Quote Post
batusoo
post
Post #4





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 24.03.2005
Skąd: działdowo

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


bo to w całości wygląda tak:
index.php
  1. <?php
  2. echo '<html><head><title>tytuł</title></head><body>';
  3.  
  4. include('lang/main.php');
  5.  
  6. echo '<table><tr><td>' . $lang['kupa'] . '</td></tr></table></body></html>';
  7. ?>


lang/main.php
  1. <?php
  2.  
  3. $lang['kupa'] = 'Kupa';
  4.  
  5. ?>
Go to the top of the page
+Quote Post
bendi
post
Post #5





Grupa: Zarejestrowani
Postów: 401
Pomógł: 5
Dołączył: 14.09.2003
Skąd: Wrocław

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


  1. <?php
  2.  print_r( $lang ); ?>
i patrz co sie pokazuje.
Go to the top of the page
+Quote Post
batusoo
post
Post #6





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 24.03.2005
Skąd: działdowo

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


No tak. Wszystko jest w porządku kiedy wyświetlam zwykłą zmienną $lang ale wszystko sie psuje kiedy użyję tablicy $lang['wartosc']
Go to the top of the page
+Quote Post
dq80
post
Post #7





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 30.04.2005

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


Jeżeli masz tak:
  1. <?php
  2.  
  3. $lang['kupa'] = 'kupa';
  4.  
  5. echo $lang['kupa'];
  6.  
  7. ?>

To wyświetla w porządku tą twoją kupę

Ten post edytował dq80 30.04.2005, 18:14:24
Go to the top of the page
+Quote Post
Wave
post
Post #8





Grupa: Zarejestrowani
Postów: 332
Pomógł: 6
Dołączył: 13.01.2005

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


A zadeklarowałeś $lang jako tablicę?
  1. <?php
  2.  $lang = array('kupa' => 'kupa'); echo $lang['kupa']; 
  3. ?>
Go to the top of the page
+Quote Post
dr_bonzo
post
Post #9





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

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


batusoo a sprawdzales to dla kodu (tlyko tego fragmentu):
  1. <?php
  2. $lang['kupa'] = 'kupa';
  3. echo $lang['kupa'];
  4.  
  5. ?>
Go to the top of the page
+Quote Post
Ociu
post
Post #10





Grupa: Moderatorzy
Postów: 1 566
Pomógł: 37
Dołączył: 14.05.2003
Skąd: Kraków




Wave:
  1. <?php
  2. $lang = array(&#092;"kupa\" => \"kupa\");
  3. # i
  4. $lang['kupa'] = 'kupa';
  5. ?>

To nie to samo ?

Ten post edytował Ociu 1.05.2005, 10:27:55
Go to the top of the page
+Quote Post

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: 22.08.2025 - 16:30