Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] operator &, do czego służy?
.luki
post
Post #1





Grupa: Zarejestrowani
Postów: 29
Pomógł: 1
Dołączył: 15.10.2007

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


Ucząc się i przeglądając źródła vBulletin natrafiam na takie coś:
  1. <?php
  2. function vB_Input_Cleaner(&$registry)
  3. ?>


  1. <?php
  2. if (isset($_POST["$varname"]))
  3. {
  4. $_REQUEST["$varname"] =& $_POST["$varname"];
  5. }
  6. ?>



  1. <?php
  2. function &clean_array(&$source, $variables)
  3. {
  4. $return = array();
  5.  
  6. foreach ($variables AS $varname => $vartype)
  7. {
  8. $return["$varname"] =& $this->clean($source["$varname"], $vartype, isset($source["$varname"]));
  9. }
  10.  
  11. return $return;
  12. }
  13. ?>


  1. <?php
  2. // initialize the input handler
  3. $this->input =& new vB_Input_Cleaner($this);
  4. ?>


No i moje pytanie jest takie - do czego jest ten operator? Domyślam się, że w przypadku =& do łączenia, ale jak?
Go to the top of the page
+Quote Post
Sabistik
post
Post #2


Administrator wortalu


Grupa: Przyjaciele php.pl
Postów: 960
Pomógł: 39
Dołączył: 21.10.2003
Skąd: Kraków

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


Naukę zaczynamy od manuala: http://pl.php.net/references
Go to the top of the page
+Quote Post
nowotny
post
Post #3





Grupa: Zarejestrowani
Postów: 875
Pomógł: 122
Dołączył: 2.02.2008

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


Jest to znak oznaczający referencje...
http://luktom.net/blog/81-referencje-w-php
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: 23.08.2025 - 13:10