\r\nExpand to see Var Dump:"; echo "

"; var_dump($var); echo "

"; echo ""; } else { var_dump($var); echo PHP_EOL; } if ($var === false) { echo 'It is FALSE!'; } elseif ($var === true) { echo 'It is TRUE!'; } elseif (is_resource($var)) { echo 'VAR IS a RESOURCE'; } elseif (is_array($var) && self::getCount($var) == 0) { echo 'VAR IS an EMPTY ARRAY!'; } elseif (is_numeric($var)) { echo 'VAR is a NUMBER = ' . $var; } elseif (empty($var) && !is_null($var)) { echo 'VAR IS EMPTY!'; } elseif ($var == 'nothing') { echo 'MISSING VAR!'; } elseif (is_null($var)) { echo 'VAR IS NULL!'; } elseif (is_string($var)) { if (! $isConsole) { echo 'VAR is a STRING = ' . htmlentities($var); } else { echo 'VAR is a STRING = ' . $var; } } else { if (! $isConsole) { echo "
";
                print_r($var);
                echo '
'; } else { print_r($var); echo PHP_EOL; } } if (! $isConsole) { echo '

'; } if ($end === endDump::EXIT_AND_STOP) { exit; } } /** * Please note that not all web servers support: HTTP_X_REQUESTED_WITH * So, you need to code more checks! * @retval boolean true if AJAX request by JQuery, etc... */ public static function isAjax(): bool { $http_x_requested_with = $_SERVER['HTTP_X_REQUESTED_WITH'] ?? ""; return (strtolower($http_x_requested_with) === 'xmlhttprequest'); } /** * site http://php.net/manual/en/function.base64-encode.php */ public static function base64urlEncode(string $data): string { return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); } public static function base64urlDecode(string $data): string { //return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT)); return base64_decode( strtr( $data, '-_', '+/') . str_repeat('=', 3 - ( 3 + strlen( $data )) % 4 )); } public static function nl2br(string $text): string { return strtr($text, array("\r\n" => '
', "\r" => '
', "\n" => '
')); } }