Easy Tutorial
❮ Php Imagecolorresolvealpha Func Array Key ❯

PHP is_string() Function

PHP Available Functions

The is_string() function is used to check if a variable is a string.

PHP Version Requirements: PHP 4, PHP 5, PHP 7

Syntax

bool is_string ( mixed $var )

Parameter Description:

Return Value

Returns TRUE if the specified variable is a string, otherwise returns FALSE.

Example

<?php
if (is_string("2663"))
    echo 'This is a string.' . PHP_EOL;
else
    echo 'This is not a string.';
var_dump(is_string('XYZ'));
var_dump(is_string("99"));
var_dump(is_string(123.05));
var_dump(is_string(false));
?>

Output:

This is a string.
bool(true)
bool(true)
bool(false)
bool(false)

PHP Available Functions

❮ Php Imagecolorresolvealpha Func Array Key ❯