(PHP 4, PHP 5)
gettype — Resituisce il tipo di una variabile
Restituisce il tipo della variabile PHP
var.
Non utilizzare gettype() per testare certi tipi di variabili poiché la stringa restistuita potrebbe variare nelle versioni future. Inoltre questa funzione è lenta dato che richiede confronti tra stringhe
Piuttosto utilizzare le funzioni is_*.
La stringa restituita può assumere i seguenti valori:
Nella versione 4 di PHP si dovrebbe applicare alle funzioni function_exists() o method_exists() al posto del precedente gettype().
Vedere anche settype(), is_array(), is_bool(), is_float(), is_int(), is_null(), is_numeric(), is_object(), is_resource(), is_scalar() e is_string().