PHP - Introduction Variables

Introduction

Variables keep a value for future usage.

This value stored in variable can be changed.

Demo

<?php
     $a = 1; /*w  w w.java2  s .com*/
     $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