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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Glutinous

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

    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!

  • Kevin Thorpe

    #2
    Re: Quickie (I guess...) - What does =& do?

    Glutinous wrote:[color=blue]
    > 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!
    >[/color]
    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 .

    Comment

    • k-caj

      #3
      Re: Quickie (I guess...) - What does =& do?

      Glutinous wrote:[color=blue]
      > 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).[/color]

      it's a reference

      same as

      $form = &$HTTP_POST_VAR S;

      --
      --- --- --- --- --- --- ---
      jack@croatiabiz .com


      Comment

      • Glutinous

        #4
        Re: Quickie (I guess...) - What does =& do?

        On Mon, 27 Oct 2003 10:06:55 +0000, Kevin Thorpe <kevin@pricetra k.com>
        wrote:
        [color=blue]
        >Glutinous wrote:[color=green]
        >> 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!
        >>[/color]
        >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 .[/color]

        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<b r>";
        echo 'This is $output:'." "."$output<br>< br>";

        $input = "Dogs";

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

        $output = "Cats";

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

        ?>

        ?

        Comment

        • Glutinous

          #5
          Re: Quickie (I guess...) - What does =&amp; do?

          On Mon, 27 Oct 2003 11:09:37 +0100, "k-caj" <jack@iskrica.c om> wrote:
          [color=blue]
          >Glutinous wrote:[color=green]
          >> 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).[/color]
          >
          >it's a reference
          >
          >same as
          >
          >$form = &$HTTP_POST_VAR S;[/color]

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

          Comment

          • Shawn Wilson

            #6
            Re: Quickie (I guess...) - What does =&amp; do?

            Glutinous wrote:[color=blue]
            >
            > Thank you. Your 'same as &$' enabled me to look up more info. I
            > appreciate your help![/color]

            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
            shawn@glassgian t.com

            Comment

            • Glutinous

              #7
              Re: Quickie (I guess...) - What does =&amp; do?

              On Mon, 27 Oct 2003 10:39:48 -0400, Shawn Wilson
              <shawn@glassgia nt.com> wrote:
              [color=blue]
              >Glutinous wrote:[color=green]
              >>
              >> Thank you. Your 'same as &$' enabled me to look up more info. I
              >> appreciate your help![/color]
              >
              >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[/color]

              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...

              Comment

              • John Dunlop

                #8
                Re: Quickie (I guess...) - What does =&amp; do?

                Shawn Wilson wrote:
                [color=blue]
                > 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.[/color]

                news:d6a0a71c.0 201210351.671b1 a4c@posting.goo gle.com

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

                --
                Jock

                Comment

                • Markus Weber

                  #9
                  Re: Quickie (I guess...) - What does =&amp; do?

                  "John Dunlop" <john+usenet@jo hndunlop.info> schrieb im Newsbeitrag
                  news:MPG.1a0789 008961c1a398979 3@news.freeserv e.net...[color=blue]
                  > Shawn Wilson wrote:
                  >[color=green]
                  > > 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.[/color]
                  >
                  > news:d6a0a71c.0 201210351.671b1 a4c@posting.goo gle.com[/color]

                  do you mean this?


                  Does anybody know a good search engine for strings like 'en/(*)'? Google
                  will search for 'en *' instead of 'en/(*)'.
                  [color=blue]
                  >
                  > Mostly, nonalphanumeric s aren't taken literally. But Google at
                  > least treats ampersands literally. The hash character is an odd
                  > one though.
                  >
                  > --
                  > Jock[/color]

                  bye,
                  Markus



                  Comment

                  • Shawn Wilson

                    #10
                    Re: Quickie (I guess...) - What does =&amp; do?

                    John Dunlop wrote:[color=blue]
                    >
                    > Shawn Wilson wrote:
                    >[color=green]
                    > > 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.[/color]
                    >
                    > news:d6a0a71c.0 201210351.671b1 a4c@posting.goo gle.com
                    >
                    > Mostly, nonalphanumeric s aren't taken literally. But Google at
                    > least treats ampersands literally. The hash character is an odd
                    > one though.
                    >
                    > --
                    > Jock[/color]

                    Thanks, that'll help in the future.

                    Shawn
                    --
                    Shawn Wilson
                    shawn@glassgian t.com

                    Comment

                    Working...