Entry
[+] print_f : Prints human-readable information about a variable
Dec 23rd, 2000 19:35
Philip Olson,
Function : print_r
Version : PHP4
Man : http://www.php.net/manual/function.print-r.php
Desc : "This function displays information about the values of
variables in a way that's readable by humans. If given
a string, integer or double, the value itself will be
printed. If given an array, values will be presented in
a format that shows keys and elements. Similar notation
is used for objects." -- from manual.
Explain : print_f provides valuable information about a given
input. very useful for debugging!
Example : Here's an example of print_r() 's use.
-----------------------------------------------------------------------
Use :
<pre>
<?php
print_r($HTTP_POST_VARS);
?>
</pre>
-----------------------------------------------------------------------
Input :
<pre>
<form method="get" action="<?php $PHP_SELF; ?>">
Name :<input type="text" name="name">
Email :<input type="text" name="email">
Subject :<input type="text" name="subject">
Message :<input type="text" name="message">
<input type="submit" name="submit">
</form>
</pre>
-----------------------------------------------------------------------
Output : (assuming message field left empty)
Array
(
[name] => joe smith
[email] => joe@example.com
[subject] => what is up!
[message] =>
)
-----------------------------------------------------------------------