====== Variableninhalt anzeigen (PHP) ====== ===== Beschreibung ===== Zeigt den vollständigen Inhalt einer Variable an. Berücksichtigt keine Objekt-Eigenschaften. Strings werden abgekürzt aufgeführt. ===== Code ===== $value) { echo str_repeat(' ', 3 * $depth), htmlspecialchars($key), " => "; my_var_dump($value, $depth + 1); } echo str_repeat(' ', 3 * ($depth - 1)), ")\n"; } else { $type = gettype($var); switch ($type) { case 'resource': case 'object': echo $type, "\n"; break; case 'NULL': echo "NULL\n"; break; case 'string': if (strlen($var) > 40) $var = substr($var, 0, 40). '...'; echo $type, "(\"", htmlspecialchars($var), "\")\n"; break; default: echo $type, "(", $var, ")\n"; } } }