• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

PHP Function:is_real

December 19, 2023

PHP Function: is_real

In PHP, the is_real function is used to determine whether a given variable is of the type “real” or “float”. It returns true if the variable is a real number, and false otherwise.

Syntax

The syntax for the is_real function is:

bool is_real ( mixed $var )

Here, $var is the variable being evaluated.

Return Value

The is_real function returns true if the variable is a real number, and false otherwise.

Examples

Let’s take a look at some examples to understand how the is_real function works:

$num1 = 3.14;
$num2 = 5;
$str = "Hello";

var_dump(is_real($num1));  // Output: bool(true)
var_dump(is_real($num2));  // Output: bool(false)
var_dump(is_real($str));   // Output: bool(false)

In the above example, $num1 is a real number, so is_real($num1) returns true. However, $num2 is an integer, and $str is a string, so both is_real($num2) and is_real($str) return false.

Important Note

It’s important to note that the is_real function is an alias of the is_float function in PHP. Both functions can be used interchangeably to check if a variable is a real number.

Summary

The is_real function in PHP is used to determine whether a variable is a real number or not. It returns true if the variable is a real number, and false otherwise. It can be used interchangeably with the is_float function. To learn more about VPS hosting solutions, visit Server.HK.

Recent Posts

  • CentOS Stream Explained: Key Differences from CentOS Linux
  • How to Configure FirewallD in CentOS Stream: From Essential to Production-Grade
  • Installing Docker on CentOS: A Practical Setup Guide (CentOS Stream 9/10 – 2026)
  • How to Secure a CentOS Server: 15 Essential Hardening Techniques (CentOS Stream 9/10 – 2026)
  • CentOS End of Life (EOL): What It Means and Migration Options in 2026

Recent Comments

No comments to show.

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot