PHP is_string() function
In this chapter you will learn:
- Description for PHP is_string() function
- Syntax for PHP is_string() function
- Parameter for PHP is_string() function
- Return value for PHP is_string() function
- Example - Is it a string
Description
is_string(value) returns true if value is a string.
Syntax
PHP is_string() function has the following syntax.
is_string(value)
Parameter
- value is the variable being type checked.
Return
PHP is_string() function returns true if value is a string.
Example
Is it a string.
<?php/* ja v a2s . c o m*/
$values = array(2, "2", 2.5, "2.5", null, true);
foreach ($values as $value) {
echo "is_string(";
var_export($value);
echo ") = ";
var_dump(is_string($value));
}
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- What is PHP isset() function
- Syntax for PHP isset() function
- Parameter for PHP isset() function
- Return value for PHP isset() function
- Example - Is the variable check
Home » PHP Tutorial » PHP Data Type Functions