Re: &$ in functions

Re: &$ in functions

am 30.11.2007 10:11:56 von Erwin Moller

Niels Lange wrote:
> Hi guys,
>
> at present I´m editing some old scripts from a colleague from mine. In
> one function I fund something I didn´t understand. The function looks
> like:
>
> function foobar(&$val, $key = ' ')
> {
> ...
> }
>
> Could anyone tell me what the &$ stands for? I tried to find some
> informations in Google. But it is really difficult to find some
> informations by using "php + &$" as a search string.
>
> Thanks

Hi,

read more here:
http://nl3.php.net/manual/en/language.references.pass.php

It is passing by reference.

Regards,
Erwin Moller

&$ in functions

am 30.11.2007 10:13:05 von Niels Lange

Hi guys,

at present I=B4m editing some old scripts from a colleague from mine. In
one function I fund something I didn=B4t understand. The function looks
like:

function foobar(&$val, $key =3D ' ')
{
...
}

Could anyone tell me what the &$ stands for? I tried to find some
informations in Google. But it is really difficult to find some
informations by using "php + &$" as a search string.

Thanks

Re: &$ in functions

am 30.11.2007 10:20:31 von kimandre

Niels Lange wrote:

> Hi guys,
>
> at present I´m editing some old scripts from a colleague from mine. In
> one function I fund something I didn´t understand. The function looks
> like:
>
> function foobar(&$val, $key = ' ')
> {
> ...
> }
>
> Could anyone tell me what the &$ stands for? I tried to find some
> informations in Google. But it is really difficult to find some
> informations by using "php + &$" as a search string.

By using this, you can allow your function to modify the referenced
variable.
http://php.net/language.references.pass

--
Kim André Akerø
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)

Re: &$ in functions

am 30.11.2007 11:52:20 von Niels Lange

Hi Erwin and Kim,

thanks for the quick answers!

Regards
Niels