PHP Syntax Variables Decimal

 

- Info:

- PHP has only one type of variable, called scalar.

- This tutorial shows possible ways of loading scalar with decimal number.

 

- Create:

$dec = 1.234;

$dec = 1.2e3; //1200

$dec = 7E-10; //7E-10

 

- Display:

echo ($dec);

print ($dec);

printf($dec);