By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,640 Members | 2,597 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,640 IT Pros & Developers. It's quick & easy.

Dumping an array to a web page

P: n/a
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
Jan 30 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Rik
CptDondo <ya*@NsOeSiPnAeMr.comwrote:
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
Jan 30 '07 #2

P: n/a
On Jan 30, 12:28 pm, Rik <luiheidsgoe...@hotmail.comwrote:
CptDondo <y...@NsOeSiPnAeMr.comwrote:
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>";

Jan 30 '07 #3

P: n/a
Rik
bo*********@gmail.com <bo*********@gmail.comwrote:
On Jan 30, 12:28 pm, Rik <luiheidsgoe...@hotmail.comwrote:
>CptDondo <y...@NsOeSiPnAeMr.comwrote:
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>";
Well, in my code it sometimes matters wether I have an integer '1' or a
string '1', hence the var_dump.If you don't need it the layout of print_r
is indeed somewhat 'nicer'.
--
Rik Wasmus
Jan 31 '07 #4

P: n/a
Following on from Rik's message. . .
>Well, in my code it sometimes matters wether I have an integer '1' or a
string '1', hence the var_dump.If you don't need it the layout of print_r
is indeed somewhat 'nicer'.
Please could you post a list of projects you've worked on so I can avoid
having anything to do with them.

--
PETER FOX Not the same since the pancake business flopped
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Jan 31 '07 #5

P: n/a
Rik
Peter Fox <pe******@eminent.demon.co.uk.not.this.bit.no.html wrote:
Following on from Rik's message. . .
>Well, in my code it sometimes matters wether I have an integer '1' or a
string '1', hence the var_dump.If you don't need it the layout of
print_r
is indeed somewhat 'nicer'.

Please could you post a list of projects you've worked on so I can avoid
having anything to do with them.
Hey!

It's by choice and design, not by PHP :P
Sometimes I hate variable vars....
--
Rik Wasmus
Jan 31 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.