|
Posted by ATDave on 12/04/07 23:47
On Dec 4, 5:28 pm, Michael Fesser <neti...@gmx.de> wrote:
> .oO(ATDave)
>
> >On Dec 4, 5:00 pm, Michael Fesser <neti...@gmx.de> wrote:
>
> >> For a really simple array print use either print_r() or var_dump(). For
> >> a more sophisticated result you would have to loop through the array and
> >> print out the values yourself in the way you like.
>
> >Thanks for the quick response. I don't know how to write the code for
> >an array, but I did try a couple things based on some
> >searching...unfortunately they did not work.
>
> It would help to post some code and say what did not work.
>
> >I would assume I have to
> >do a loop through the array to print out the values...but should those
> >get assigned to more variables (one for each option) so that I can
> >actually pass them through in the e-mail?
>
> No variables needed, just a simple foreach loop and a little sanity
> check. Something like:
>
> if (isset($_POST['SelfDevelopmentInterest']) &&
> is_array($_POST['SelfDevelopmentInterest'])) {
> foreach ($_POST['SelfDevelopmentInterest'] as $value) {
> // print out your stuff the way you like
> print $value;
> ...
> }
>
> }
>
> Micha
I got it figured out without doing a loop.
$SelfDevelopmentInterest = implode(', ',
$_POST['SelfDevelopmentInterest']);
This worked perfectly!
Navigation:
[Reply to this message]
|