How do I form a parameter string with multiple values and check whether a ? or & is needed for the value?
<p>I have a form that gives a lot of different options via dropdown selectors.  Like :</p>

<pre><code>&lt;!--// height //--&gt;
&lt;option value='3918'&gt;5'7"&lt;/option&gt;
&lt;option value='3917'&gt;5'8"&lt;/option&gt;
&lt;option value='3916'&gt;5'9"&lt;/option&gt;
&lt;option value='3915'&gt;5'10"&lt;/option&gt;

&lt;!--// weight //--&gt;
&lt;option value='3913'&gt;101-120lbs&lt;/option&gt;
&lt;option value='3912'&gt;121-140lbs&lt;/option&gt;
&lt;option value='3911'&gt;141-160lbs&lt;/option&gt;
&lt;option value='3910'&gt;161-180lbs&lt;/option&gt;
</code></pre>

<p>I need to associate those numbers with another variable that allows filtering from thte url parameters.  SO for example I have a switch statement like : </p>

<pre><code>if (isset($form['height'])){
        $hv = $wizard['height'];
        $hvr = '4\'0"';
        $hvd = 0;
        switch ( $hv ) 
            {
            case 3915 : $hvd= 4294964526; $hvr = '5\'10"'; break;
            case 3916 : $hvd= 4294964528; $hvr = '5\'9"'; break;
            case 3917 : $hvd= 4294964529; $hvr = '5\'8"'; break;
            case 3918 : $hvd= 4294964406; $hvr = '5\'7"'; break;
            }
     }

if (isset($wizard['weight'])){
    $wv = $wizard['weight'];
    $wvr = '100 lbs';
    $wvd = 0;
    switch ( $wv ) 
    {
        case 3910 : $wvd = 4294964413; $wvr = '161-180 lbs'; break;
        case 3911 : $wvd = 4294964421; $wvr = '141-160 lbs'; break;
        case 3912 : $wvd = 4294964422; $wvr = '121-140 lbs'; break;
        case 3913 : $wvd = 4294964400; $wvr = '121-140 lbs'; break;
    }
}
</code></pre>

<p>The variable being generated in the switch is what needs to be appended at the end of the url parameters. </p>

<p>So for example a correct url from this submission of a 5'7" 150lb would look along the lines of :</p>

<pre><code>site.com?height=3918&amp;weight=3911&amp;d=4294964421,4294964406
</code></pre>

<p>Now I need to pass these into a url parameter to redirect to when form is submitted.  </p>

<p>So to start I guess I need to build that string in each individual <code>if(isset)</code>?  So for just height I would have</p>

<p><code>$this-&gt;getResponse()-&gt;setRedirect( "site.com?height=" . $hv ."&amp;d=" . $hvd );</code></p>

<p>but what would be the best way to build these strings with multiple POST values?  How do I check if there needs to be a <code>?</code> or <code>&amp;</code> for that value in the parameter?  How would I check if a <code>,</code> is necessary when there are multiple d values?</p>
