Learn PHP Data Type 


For instance , There is one employee in office his name is Akshay Dhiman and his salary is $2000. Lets see how we represent the employee in PHP script:

<?php
$employee_name = 'Akshay Dhiman';
$employee_salary = 2000;

?>

Now in this script ,there is two data types $employee_name  and $employee_salary  . 

$employee_name = String 
$employee_salary   Integer

This also matter when you used in expressions and operations . See in this example , the gender title is added into employee name and salery is increased using extra value .

<?php
$employee_name = 'Mr '.$employee_name;
$employee_salary = $employee_salary +200;
?>
 
Basically PHP data type is used to carry different type of values and data .PHP supports ten primitive types which are categorized in these 3 steps: 

Scalar ,Compound ,Special 

Scalar types:

Boolean
Integer
Float (floating-point number, aka double)
String

Compound types:

Array
Object
Callable
Iterable

Special types:

resource
NULL


Last Updated: 2018-07-06 12:32:44 By akshay

SHARE THIS

share_facebook share_twitter share_google_plus

Please Comment Here :