Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] jak sprawdzić typ zmiennej?
robal94
post
Post #1





Grupa: Zarejestrowani
Postów: 150
Pomógł: 2
Dołączył: 14.06.2009
Skąd: Czestochowa

Ostrzeżenie: (0%)
-----


jak sprawdzić typ zmiennej?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
Larges
post
Post #2





Grupa: Zarejestrowani
Postów: 333
Pomógł: 16
Dołączył: 13.05.2008
Skąd: Łódź

Ostrzeżenie: (0%)
-----


http://pl.php.net/manual/pl/function.gettype.php

Ten post edytował Larges 7.10.2009, 16:56:17
Go to the top of the page
+Quote Post
robal94
post
Post #3





Grupa: Zarejestrowani
Postów: 150
Pomógł: 2
Dołączył: 14.06.2009
Skąd: Czestochowa

Ostrzeżenie: (0%)
-----


nie rozumiem tej funkcji...
Go to the top of the page
+Quote Post
Larges
post
Post #4





Grupa: Zarejestrowani
Postów: 333
Pomógł: 16
Dołączył: 13.05.2008
Skąd: Łódź

Ostrzeżenie: (0%)
-----


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).

(IMG:style_emoticons/default/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

Ten post edytował Larges 7.10.2009, 17:11:41
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.12.2025 - 20:38