Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zmienne superglobalne, Dlaczego tak nie dziala ?
Bastion
post
Post #1





Grupa: Zarejestrowani
Postów: 505
Pomógł: 0
Dołączył: 8.01.2005

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


czy ktos wie dlaczego dziala tak :

  1. <?php
  2.  $tablica = array(0,1,2,3,4);
  3.  $el = 'tablica';
  4.  print_r(${$el});
  5.  
  6. ?>


a nie dziala tak :

  1. <?php
  2. $el = '_SERVER';
  3. print_r(${$el});
  4. ?>


Ten post edytował Bastion 10.03.2006, 08:41:58
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
mike
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

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


A nie możesz tak:
  1. <?php
  2.  
  3. function register( &$arrSuperglobal, $strVar, $strFilter )
  4. {
  5. print_r( $arrSuperglobal );
  6. }
  7.  
  8. register( $_GET, 'id', 'digit' );
  9. register( $_POST, 'value', 'chars' );
  10.  
  11. ?>
:?:
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: 13.06.2026 - 22:27