This repository was archived by the owner on Dec 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
debug.inc
Tadatoshi Tokutake edited this page May 25, 2015
·
10 revisions
- withln
- echoln
- pretty
- var_detail
- print_detail
- html_friendly
- hf_echoln
- hf_pretty
- hf_var_export
- hf_print_r
string withln(mixed $var)
- Return the string stringified from
$varwith a line break. - Example:
echo withln(1.0); // => 1.0void echoln(mixed $var)
- Output withln(
$var). - Example:
echoln(null); // => nullstring pretty(mixed $var, string $row_prefix = '')
- Return the pretty string for
$var. - Example:
echo pretty(['one' => 1, 'two' => 2, 'three' => 3], '-');
// => - (count: 3)[
// - 'one' => 1,
// - 'two' => 2,
// - 'three' => 3,
// - ]string var_detail(mixed $var)
- Return
var_export($var, true).
string print_detail(mixed $var)
- Return
print_r($var, true).
string html_friendly(string $string, bool $comment_out = true)
- Return the string which wrapped by "<pre>" tags.
- Example:
echo html_friendly('with the comment out');
// => <!--<pre>
// with the comment out</pre>-->
echo html_friendly('without the comment out', false);
// => <pre>
// without the comment out</pre>void hf_echoln(mixed $var, bool $comment_out = true)
- Output html_friendly(withln(
$var),$comment_out). - Example:
hf_echoln('with comment out');
// => <!--<pre>
// with comment out
// </pre>-->void hf_pretty(mixed $var, bool $comment_out = true)
- Output html_friendly(pretty(
$var),$comment_out).
void hf_var_export(mixed $var, bool $comment_out = true)
- Output html_friendly(var_detail(
$var),$comment_out).
void hf_print_r(mixed $var, bool $comment_out = true)
- Output html_friendly(print_detail(
$var),$comment_out).
Welcome any issure or pull request!
Please contact me by mail to tadatoshi.tokutake@gmail.com if you have some questions!