Jessica Mather Jessica Mather - 4 months ago 7x
PHP Question

How can I get the values of a multiselect into an echo statement?

I am trying to get the values of a multiselect to be listed into a php email form. The variable is name="variable[] "

I don't know how to go about it, so any advice would be awesome

$message = "<html><head><title></title></head>
<p>Another Sentence". [I want to put an array here]."</p>


Something like this? (Untested)

$message = "
            <p>Sentence" .$_POST['somevarriable']. "</p>
            <p>Another Sentence "

    foreach ($_POST['variable'] as $selectedOption){
        $message .= $selectedOption . ' ';

    $message .= "


How to get multiple selected values of select box in php?