PHP - is_string
Trieda
Metóda - is_string
(PHP 4, PHP 5, PHP 7)
The is_string() function checks whether a given value is of the
string type.
Procedurálne
- function is_string (mixed $var) : bool
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $var | mixed | The value/variable to be checked. |
Mávratovej hodnoty
Vracia: bool
Returns true if the value is of the string type,
false otherwise.
Príklady
<?php
var_dump(is_string('text')); // True
var_dump(is_string(null)); // False
var_dump(is_string(false)); // False
var_dump(is_string('')); // True
var_dump(is_string(12)); // False
var_dump(is_string('12')); // True
