User Tools

Site Tools


uphp:functions:is_string

This is an old revision of the document!


is_string

WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0

Return 1 if the variable is a string

Description

int is_string ( mixed $variable )

Check if a variable or value is a string

Parameters

variable: Variable or expression to be evaluated

Return Value

1 (true) if a string, 0 (false) if not a string

Examples

<?
$x=1.0;
print(is_string($x)); //outputs 0, $x is a float
$y="1.0";
print(is_string($y)); //outputs 1, $y is a string
$z=''
print(is_string($z)); //outputs 1, $z is an empty string
?>

Notes

This function checks ONLY the type of the variable, not the data that it holds!

See Also

is_int() - Return 1 if the variable is an integer

is_float() - Return 1 if the variable is a float

is_numeric() - Return 1 if the value is numeric (integer, float or numeric string)

is_array() - Return 1 if the variable is an array

uPHP Variable Types and Limits

uphp/functions/is_string.1489139927.txt.gz · Last modified: 2021/09/13 05:56 (external edit)