Page 1 of 1

& in arrays

Posted: Thu Mar 06, 2008 3:44 am
by m2babaey
Hi
What is the job of the "&" in &options in the code below?
thanks

Code: Select all

    function addSelect($name, $label, $default, &$options) {
         $this->_elements[$name] = array('type' => 'select', 'label' => $label, 'value' => $default,
            'options' => $options);
     }

Re: & in arrays

Posted: Thu Mar 06, 2008 5:06 am
by N1gel
The & symbol is used to pass a variable into a function by reference.

You can read about it in the PHP Manual

http://php.mirror.camelnetwork.com/manu ... s.pass.php

Hope this helps

Nigel :D