Home>Article>Backend Development> How to determine whether a variable is a scalar using is_scalar in php

How to determine whether a variable is a scalar using is_scalar in php

不言
不言 forward
2019-03-09 13:44:53 2388browse

The content of this article is about how is_scalar in PHP determines whether a variable is a scalar. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

is_scalar -- Check whether a variable is a scalar

Scalar variables refer to those variables that contain integer, float, string or boolean, while array, object and resource are not scalars.

 // string(10) "hemoglobin" // [1]=> // string(20) "cytochrome c oxidase" // [2]=> // string(10) "ferredoxin" // } ?>

The above is the detailed content of How to determine whether a variable is a scalar using is_scalar in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete