Home>Article>Backend Development> How to determine whether a variable is a scalar using is_scalar in php
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!