var_dump — Dumps information about a variable
This function displays structured information about one or more expressions that includes its type and value. Arrays and objects are explored recursively with values indented to show structure.
In PHP 5 all public, private and protected properties of objects will be returned in the output.
For example, here's an output of a variable
array(3) { [0]=> object(stdClass)#17 (3) { ["id"]=> string(1) "1" ["news_date"]=> string(10) "2011-04-07" ["news"]=> string(15) "TEst nouvelle 1" } [1]=> object(stdClass)#18 (3) { ["id"]=> string(1) "2" ["news_date"]=> string(10) "2011-04-07" ["news"]=> string(16) "Test nouvelles 2" } [2]=> object(stdClass)#19 (3) { ["id"]=> string(1) "3" ["news_date"]=> string(10) "2011-04-07" ["news"]=> string(16) "Test nouvelles 3" } }
Hi,
ReplyDeleteYou can use print_r() command.
Example: var a = array();
echo "<pre>".print_r($a,true)."</pre>";
for better output.
Thanks!
ReplyDelete