Results 1 to 2 of 2

Thread: Question about +=

  1. #1
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default Question about +=

    A friend of mine saw "+=" in a script and asked me what it meant.
    I searched php.net and google and everything, and I've come up empty handed.
    "plus equals"???
    I don't get it.
    Explain?

  2. #2
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Here is an example
    PHP Code:
    <?php
    $num 
    5;
    $num += 10;
    echo 
    $num
    ?>
    that will produce 15. it is equivalent to
    PHP Code:
    <?php
    $num 
    5;
    $num =  $num 10;
    echo 
    $num
    ?>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •