Float

This data type represents decimal values. The float (floating point number) is a number with a decimal point or a number in exponential form.

Syntax

snippet
$a=1.234;
$x=1.2e4;
$y=7E-10;

Example 1

snippet
<?php
	$x=22.41;
	echo $x;
?>

Output:

PHP Float

Example 2

snippet
<?php 
    $a = 11.365;
    var_dump($a);
?>

Output:

PHP Float

Example 3

snippet
<?php
	$a = 6.203;
	$b = 2.3e4;
	$c = 7E-10;
	var_dump($a);
	var_dump($b);
	var_dump($c);
?>

Output:

PHP Float

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials

Preparation

Trending Technologies

B.Tech / MCA

Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +