You are here: Re: foreach loop contains arrays in some values « PHP Programming Language « IT news, forums, messages
Re: foreach loop contains arrays in some values

Posted by David Haynes on 04/15/06 02:15

Jack E Leonard wrote:
> I'm looping through the keys and values of a form submission using
>
> foreach($_POST as $key => $value)
> echo "$key = $value<br>";
>
> No problems there. All works as expected. But seveal of the values are
> arrays and the echo comes out like:
>
> subjectone = Array
> subjecttwo = Array
>
> There could be as many as 9 elements in each array but there may be as
> few as one. How can I get those $value that are arrays to echo the
> entire array using a foreach loop? I would like to end up with all
> values printed in the page whether in an array or not.
>
> Thanks

If you don't want to do anything but display them, I would use print_r.

e.g.

echo "<pre>\n";
print_r($_POST);
echo "</pre>\n";

-david-

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация