downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

debug_zval_dump> <Vordefinierte Konstanten
Last updated: Fri, 30 Oct 2009

view this page in

Funktionen zur Behandlung von Variablen

Inhaltsverzeichnis

  • debug_zval_dump — Dumps a string representation of an internal zend value to output
  • doubleval — Alias von floatval
  • empty — Prüft, ob eine Variable einen Wert enthält
  • floatval — Konvertiert einen Wert nach float
  • get_defined_vars — Gibt ein Array aller definierten Variablen zurück
  • get_resource_type — Returns the resource type
  • gettype — Liefert den Datentyp einer Variablen
  • import_request_variables — Import GET/POST/Cookie variables into the global scope
  • intval — Konvertiert einen Wert nach integer
  • is_array — Prüft, ob die Variable ein Array ist
  • is_binary — Prüft ob eine Variable ein nativer Binärstring ist
  • is_bool — Prüft, ob eine Variable vom Typ boolean ist
  • is_buffer — Prüft, ob eine Variable ein nativer Unicode- oder Binärstring ist
  • is_callable — Prüft ob der Inhalt einer Variable als Funktion aufgerufen werden kann
  • is_double — Alias von is_float
  • is_float — Prüft, ob eine Variable vom Typ float ist
  • is_int — Prüft, ob eine Variable vom Typ int ist
  • is_integer — Alias von is_int
  • is_long — Alias von is_int
  • is_null — Prüft ob eine Variable NULL enthält
  • is_numeric — Prüft, ob eine Variable eine Zahl oder ein numerischer String ist
  • is_object — Prüft, ob eine Variable vom Typ object ist
  • is_real — Alias von is_float
  • is_resource — Prüft, ob eine Variable vom Typ resource ist
  • is_scalar — Prüft ob eine Variable skalar ist
  • is_string — Prüft, ob Variable vom Typ string ist
  • is_unicode — Prüft ob eine Variable ein Unicode-String ist
  • isset — Prüft, ob eine Variable existiert und ob sie nicht NULL ist
  • print_r — Gibt Variablen-Informationen in lesbarer Form aus
  • serialize — Erzeugt eine speicherbare Repräsentation eines Wertes
  • settype — Legt den Typ einer Variablen fest
  • strval — Ermittelt die String-Repräsentation einer Variable
  • unserialize — Erzeugt aus einem gespeicherten Datenformat einen Wert in PHP
  • unset — Löschen einer angegebenen Variablen
  • var_dump — Gibt alle Informationen zu einer Variablen aus
  • var_export — Outputs or returns a parsable string representation of a variable


add a note add a note User Contributed Notes
Funktionen zur Behandlung von Variablen
jfrasca at sheerdev dot com
31-Aug-2005 07:27
I needed a simple function that would reduce any kind of variable to a string or number while retaining some semblance of the data that was stored in the variable. This is what I came up with:

<?
function ReduceVar ($Value) {
    switch (gettype($Value)) {
        case "boolean":
        case "integer":
        case "double":
        case "string":
        case "NULL":
            return $Value;
        case "resource":
            return get_resource_type($Value);
        case "object":
            return ReduceVar(get_object_vars($Value));
        case "array":
            if (count($Value) <= 0)
                return NULL;
            else
                return ReduceVar(reset($Value));
        default:
            return NULL;
    }
}
?>
skelley at diff dot nl
23-Sep-2001 01:55
Sorry to say Mykolas, but your definition would not be correct.

isempty() evaluates to true for NULL, 0, "", false or 'not set' for any variable, object etc. that can be set to a value.

isset() evaluates to true if the variable, object etc. exists at all, whether it is 'empty' or not.

Example:
$foo = 0;
isset($foo); //will evaluate to true.
!empty($foo); //will evaluate to false.

unset($foo);
isset($foo); //will evaluate to false.
!empty($foo); //will evaluate to false.

debug_zval_dump> <Vordefinierte Konstanten
Last updated: Fri, 30 Oct 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites