settype()
bool settype(mixed &$var, string $type)
Setta il tipo della variabile $var a $type e restituisce TRUE in caso di successo, FALSE in caso di fallimento.
Si può scegliere tra
- "boolean", "bool", "integer", "int", "float"
- "array", "string", "object", "null"
gettype()
Sconsigliato, meglio is_...().
Restituisce un messaggio relativo al tipo della variabile analizzata:
- "boolean", "integer", "double"
- “string”, “array”, “object”, “resource”, “NULL”, “unknown type”
isset()
Il parametro deve essere una variabile.
Restituisce TRUE se la variabile
- è stata impostata
- non è stata assegnata a NULL
- non ha subito unset()
unset()
…
empty()
Il parametro deve essere una variabile.
Restituisce TRUE se la variabile ha il valore
- "" (stringa vuota)
- 0 (intero)
- "0" (stringa)
- NULL
- FALSE
- array() (array vuoto)
is_…
is_bool() | … |
is_scalar() | comprende integer, float, string, boolean |
is_numeric() | numero o stringa numerica |
is_double() is_float() is_real() |
… |
is_int() is_integer() is_long() |
… |
is_string() is_array() is_object() is_resource() is_null() |
… |
…val()
doubleval() | … | |
floatval() | … | |
intval() | … | |
intval() | $s $n |
Trasforma in intero la stringa $s in base $n |
strval() | … |