adding variables

Discussion in 'PHP' started by pshaw, Apr 14, 2021.

  1. #1
    PHP - I need to add "a1" to "a2" to "a3" then that total becomes "sum"
     
    pshaw, Apr 14, 2021 IP
  2. Efetobor Agbontaen

    Efetobor Agbontaen Active Member

    Messages:
    137
    Likes Received:
    41
    Best Answers:
    5
    Trophy Points:
    85
    #2
    You mean like this:

    $sum = $a1 + $a2 + $a3;
    PHP:
     
    Efetobor Agbontaen, Apr 14, 2021 IP
    JEET and sarahk like this.