Friday, November 20
Trending
- US Outages Explained: What Happened to Microsoft, FAA and Banks
- Microsoft 365 Outage: Outlook, Teams and Copilot Down. What We Know
- Diwali Online Shopping Scams 2026: 10 Ways to Stay Safe
- 10 Best DDoS Protection Services for 2027
- 12 Best Web Application Firewalls (WAF) for 2027
- Best Ethical Hacking Tools in 2027: Free & Paid Picks
- Software supply chain attacks 2026: Timeline and developer checklist
- Binance Hack: $6.3 Billion Drained in the Largest Crypto Theft Ever. What We Know So Far
PHP gives automatic data type conversion.
For example, if you provide an integer value to a variable, the type of that variable will automatically be an integer. Next, if you provide a string to the same variable, the type will change to a string.
Integers
It is a number without any decimal part.
Following functions are used to check if the type of a variable is integer:
- is_int()
- is_integer()
- is_long()
Example:
<?php $a = 100; $b = -150; ?>
Float
It is a number with a decimal point or a number in the exponential pattern.
Following functions are used to check if the type of a variable is float:
- is_float()
- is_double()
Example:
<?php $a = 21.9; $b = -15.351; ?>
NaN
NaN stands for Not a Number.
The following function is used to check if a value is not a number.
- is_nan()



