Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP] jak sprawdzić typ zmiennej?
Forum PHP.pl > Forum > Przedszkole
robal94
jak sprawdzić typ zmiennej?
robal94
nie rozumiem tej funkcji...
Larges
funkcja sprawdza typ zmiennej. Czy zmienna jest ciągiem znaków (string), liczbą (integer), czy ma wartość logiczną (true/false), czy jest obiektem (object) czy tablicą (array).

party.gif

jak chcesz możesz też sprawdzać ciut inaczej, np. za pomocą funkcji
is_array() - sprawdzasz czy zmienna jest tablicą - array();
is_int() - czy jest liczbą...


Zobacz też:

* settype() - Set the type of a variable
* is_array() - Finds whether a variable is an array
* is_bool() - Finds out whether a variable is a boolean
* is_float() - Finds whether the type of a variable is float
* is_int() - Find whether the type of a variable is integer
* is_null() - Finds whether a variable is NULL
* is_numeric() - Finds whether a variable is a number or a numeric string
* is_object() - Finds whether a variable is an object
* is_resource() - Finds whether a variable is a resource
* is_scalar() - Finds whether a variable is a scalar
* is_string() - Find whether the type of a variable is string
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.