0% found this document useful (0 votes)
3 views

data types in php

The document outlines the built-in data types in PHP, which include String, Integer, Float, Boolean, Array, and NULL. Each data type is briefly defined, with examples provided for String and explanations for the others. The document emphasizes the importance of data types in ensuring proper operations without errors.

Uploaded by

dethspiker2849
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

data types in php

The document outlines the built-in data types in PHP, which include String, Integer, Float, Boolean, Array, and NULL. Each data type is briefly defined, with examples provided for String and explanations for the others. The document emphasizes the importance of data types in ensuring proper operations without errors.

Uploaded by

dethspiker2849
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

DataTypes in php Data type specifies the type of value a variable requires to do various operations without causing an error.

By default, PHP
provides the following built-in data types:

String
Integer
Float
Boolean
Array
NULL

1. String A string is a sequence of characters that holds letters and numbers. It can be anything written inside single or double quotes. For
Example:

<?php

$x ="hello world!";

echo $x;

?>

2. Integer An integer is a non-decimal number typically ranging between -2,147,483,648 and 2,147,483,647.
3. Float A float is a number with a decimal point. It can be an exponential number or a fraction.

4. Boolean A Boolean represents two values: True or False.

5. Array Array is a collection of similar data elements stored in a single variable.

6. NULL Null is a special data type with only one value which is NULL. In PHP, if a variable is created without passing a value, it will
automatically assign itself a value of NULL.

You might also like