PHP Primitive Datatypes
When we deal with different types of values e.g. Rollno, Name, Address then we need datatypes which is used to identify a specific type of data and allow operations on the datatype.
In PHP there are different type of primitive datatypes- Integer Datatype- Integers are whole numbers without a decimal point. e.g. 2, 2797, 989 etc.
- Double Datatype- Double values are decimal or fractional numbers e.g. 17.01, -23.5, +2890.08 etc.
- String Datatype- Stings are sequence of characters. We can write strings using single quotes and double quotes
Single and double quotes valid in PHP but there is difference in single quoted and double quoted strings.
Single quoted list all the character without any change, but double quote produce different sting output
E.g.
<?PHP
Echo 'This is \"a\" quoted character';
Echo "<br/>";
Echo "This is \"a\" quoted character";
?>
Output:
This is \"a\" quoted character
This is "a" quoted character
UNIT-304
Elementary Server Side Scripting through PHP
- Boolean Datatype- This datatype has only two possible values True and False.
Elementary Server Side Scripting through PHP