PHP - Introduction Variables

Introduction

Variables keep a value for future usage.

This value stored in variable can be changed.

Demo

<?php
     $a = 1; /*from w  w w.j a  v  a  2  s  .  c  om*/
     $b = 2; 
     $c = $a + $b; 
     echo $c; // 3 
?>

Result

Here, we have three variables: $a has value 1, $b has 2, and $c contains the sum of $a and $b, hence, $c equals 3.

Related Topics

Exercise