By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,695 Members | 1,284 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,695 IT Pros & Developers. It's quick & easy.

Quickie (I guess...) - What does =& do?

P: n/a
Trying to learn php, and came across

=&

as in

$form =& $HTTP_POST_VARS;

I can't find any reference to =&, with no success in searching for a
definition (as though it's _so_ obvious it doesn't need explanation).

Thanks!

Jul 17 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Glutinous wrote:
Trying to learn php, and came across

=&

as in

$form =& $HTTP_POST_VARS;

I can't find any reference to =&, with no success in searching for a
definition (as though it's _so_ obvious it doesn't need explanation).

Thanks!

It sets $form to be another refernce to $HTTP_POST_VARS. Thus changing
the contents of one affects the other. Without the ampersand $form
becomes a copy of $HTTP_POST_VARS.

Jul 17 '05 #2

P: n/a
Glutinous wrote:
Trying to learn php, and came across
I can't find any reference to =&, with no success in searching for a
definition (as though it's _so_ obvious it doesn't need explanation).


it's a reference

same as

$form = &$HTTP_POST_VARS;

--
--- --- --- --- --- --- ---
ja**@croatiabiz.com
Jul 17 '05 #3

P: n/a
On Mon, 27 Oct 2003 10:06:55 +0000, Kevin Thorpe <ke***@pricetrak.com>
wrote:
Glutinous wrote:
Trying to learn php, and came across

=&

as in

$form =& $HTTP_POST_VARS;

I can't find any reference to =&, with no success in searching for a
definition (as though it's _so_ obvious it doesn't need explanation).

Thanks!

It sets $form to be another refernce to $HTTP_POST_VARS. Thus changing
the contents of one affects the other. Without the ampersand $form
becomes a copy of $HTTP_POST_VARS.


Thank you so much! Very helpful...

So whatever happens to the one, happens to the other also (in a manner
of speaking). As in ($input and $output being arbitary names):

<?php

$input =& $output;

echo '$input and $output are unassigned.<br>This is $input:'."
"."$input<br>";
echo 'This is $output:'." "."$output<br><br>";

$input = "Dogs";

echo '$input is now set to "Dogs".<br>This is $input:'."
"."$input<br>";
echo 'This is $output:'." "."$output<br><br>";

$output = "Cats";

echo '$output is now set to "Cats".<br>This is $input:'."
"."$input<br>";
echo 'This is $output:'." "."$output<br>";

?>

?

Jul 17 '05 #4

P: n/a
On Mon, 27 Oct 2003 11:09:37 +0100, "k-caj" <ja**@iskrica.com> wrote:
Glutinous wrote:
Trying to learn php, and came across
I can't find any reference to =&, with no success in searching for a
definition (as though it's _so_ obvious it doesn't need explanation).


it's a reference

same as

$form = &$HTTP_POST_VARS;


Thank you. Your 'same as &$' enabled me to look up more info. I
appreciate your help!

Jul 17 '05 #5

P: n/a
Glutinous wrote:

Thank you. Your 'same as &$' enabled me to look up more info. I
appreciate your help!


Slightly off topic, but I've had trouble in the past looking up non-text
functions and operators (<<<, &, @, etc.). It seems Google likes to ignore
them, even when quoted. Does anyone know a good method/place to look these up?

Thanks,
Shawn

--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #6

P: n/a
On Mon, 27 Oct 2003 10:39:48 -0400, Shawn Wilson
<sh***@glassgiant.com> wrote:
Glutinous wrote:

Thank you. Your 'same as &$' enabled me to look up more info. I
appreciate your help!


Slightly off topic, but I've had trouble in the past looking up non-text
functions and operators (<<<, &, @, etc.). It seems Google likes to ignore
them, even when quoted. Does anyone know a good method/place to look these up?

Thanks,
Shawn


Well, there's here... :-)

I even found searching the pdf-format php manual wasn't much help with
my query, and I didn't have any success with searching for lists of
functions and operators...

Jul 17 '05 #7

P: n/a
Shawn Wilson wrote:
Slightly off topic, but I've had trouble in the past looking up non-text
functions and operators (<<<, &, @, etc.). It seems Google likes to ignore
them, even when quoted.


news:d6**************************@posting.google.c om

Mostly, nonalphanumerics aren't taken literally. But Google at
least treats ampersands literally. The hash character is an odd
one though.

--
Jock
Jul 17 '05 #8

P: n/a
"John Dunlop" <jo*********@johndunlop.info> schrieb im Newsbeitrag
news:MP************************@news.freeserve.net ...
Shawn Wilson wrote:
Slightly off topic, but I've had trouble in the past looking up non-text
functions and operators (<<<, &, @, etc.). It seems Google likes to
ignore
them, even when quoted.
news:d6**************************@posting.google.c om


do you mean this?
http://groups.google.com/groups?hl=e...ing.google.com

Does anybody know a good search engine for strings like 'en/(*)'? Google
will search for 'en *' instead of 'en/(*)'.

Mostly, nonalphanumerics aren't taken literally. But Google at
least treats ampersands literally. The hash character is an odd
one though.

--
Jock


bye,
Markus

Jul 17 '05 #9

P: n/a
John Dunlop wrote:

Shawn Wilson wrote:
Slightly off topic, but I've had trouble in the past looking up non-text
functions and operators (<<<, &, @, etc.). It seems Google likes to ignore
them, even when quoted.


news:d6**************************@posting.google.c om

Mostly, nonalphanumerics aren't taken literally. But Google at
least treats ampersands literally. The hash character is an odd
one though.

--
Jock


Thanks, that'll help in the future.

Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.