1. Quick Explanation: Scalar data types are used to represent a single value. Several data types fall under this category, including Boolean, integer, float, and string. Good Practise: Variables can store data of different types, and different data types can do different things. 2. Example 1 – Scalar Data Types: ScalarDataTypes.php // decimal base integers […]

# datatypes

## Integers

1. Quick Explanation: Integers can be specified in decimal (base 10), hexadecimal (base 16), octal (base 8) or binary (base 2) notation. The negation operator can be used to denote a negative integer. Good Practise: Variables can store data of different types, and different data types can do different things. 2. Example 1 – Integers: […]

## Doubles

1. Quick Explanation: Double: Can hold numbers containing fractional or decimal part including positive and negative numbers. By default, the variables add a minimum number of decimal places. Good Practise: Variables can store data of different types, and different data types can do different things. 2. Example 1 – Doubles: Doubles.php $a = 1.234; var_dump($a); […]

## Boolean

1. Quick Explanation: Boolean Variables helps to make decisions or store a decision based on an expression.Boolean values can be true or false. Good Practise: Variables can store data of different types, and different data types can do different things. 2. Example 1 – Boolean: Boolean.php $result = 2 > 1; $message = ($result) ? […]

## Strings

1. Quick Explanation: Strings in PHP can be enclosed with Single Quote or Double Quotes.You can use Single quotes inside the double quotes and vice-versa. Good Practise: Variables can store data of different types, and different data types can do different things. 2. Example 1 – Strings: Strings.php $fullName = ‘WPFreelancer’; $site = “http://$fullName.com/”; echo […]

## NULL

1. Quick Explanation: The special NULL value is used to represent empty variables in PHP. A variable of type NULL is a variable without any data. NULL is the only possible value of type null. Good Practise: Variables can store data of different types, and different data types can do different things. 2. Example 1 […]