Online visitors

People learning around the world

Online

—

Visitors exploring W3Schools

Online visitors by country Circles show approximate country locations. The country list provides the visitor counts.

Circles represent countries, not exact visitor locations.

Country

Online

Loading country activity…

    PHP Assignment Operators

    PHP assignment operators applied to assign the result of an expression to a variable. = is a fundamental assignment operator in PHP. It means that the left operand gets set to the value of the assignment expression on the right.

    Operator Description
    = Assign
    += Increments then assigns
    -= Decrements then assigns
    *= Multiplies then assigns
    /= Divides then assigns
    %= Modulus then assigns

    Example:

    <?php
      $var = "value";  // $var now contains the string "value"
      $var = 1;    // $var now contains the integer value 1
      $var += 3;    //$var now contains the integer 4
    ?>


    Found This Page Useful? Share It!
    Get the Latest Tutorials and Updates
    Join us on Telegram

    Notifications

    Updates are enabled for this browser.

    Receive new tutorials, articles and learning resources. You can turn updates off anytime.