Re: Dumping an array to a web page



On Jan 30, 12:28 pm, Rik <luiheidsgoe...@xxxxxxxxxxx> wrote:
CptDondo <y...@xxxxxxxxxxxxxxxx> wrote:
Is there some quick way to dump an array to a webpage and have it show
up neatly formatted rather than the typical blob-o-text?

Thanks,

--Yan

echo '<pre>';
var_dump($var);
echo '</pre>';

--
Rik Wasmus

there is also print_r() which is much nicer for arrays imo

print "<pre>";
print_r($arr);
print "</pre>";

.



Relevant Pages

  • Re: PHP Blank Page.
    ... echo mysql_error, ... Rik Wasmus ... ID intunsigned zerofill NOT NULL auto_increment, ... PRIMARY KEY ...
    (comp.lang.php)
  • Re: PHP Blank Page.
    ... echo mysql_error, ... Rik Wasmus ... I can clearly see that's not the query you are performing. ... mysql> select * from questions; ...
    (comp.lang.php)
  • Re: PHP Blank Page.
    ... > Wether there's a parse error in your other includes I couldn't say. ... > echo it to check wether the result has data or is empty, ... > Rik Wasmus ... I removed the header file and now it doesn't report anything. ...
    (comp.lang.php)
  • Re: $_GET works, $_POST doesnt
    ... If you're not sure about the latter part, try FireFox with the LiveHTTPHeaders plugin. ... echo "email exists\n"; ... Rik Wasmus ...
    (comp.lang.php)
  • Re: printing collumn names then contents from mysql query
    ... without referencing by name (using a loop) echo there name in a td ... i think the foreach statement is what im ... Rik Wasmus ...
    (comp.lang.php)