php variable being overwrittin when trying to display array
<p>I think my title might not be a good explanation so hopefully this will be...</p>

<p>Here are the parts of the code I am working on:</p>

<pre><code>    $UpcomingEvent = 'is_upcoming_event';
    $ThermometerEvent = 'is_thermometer_event';
    $GLOBALS['champs_extra'] = array (
        'articles' =&gt; array (
            $nis =&gt; "checkbox|propre|New Inspirational Stories?",
            $UpcomingEvent =&gt; "checkbox|propre|Is a Upcoming Event? (&lt;em&gt;present into Home page?&lt;/em&gt;)",
            $ThermometerEvent =&gt; "checkbox|propre|Add thermometer to event?",
            'redirect_to_hyperlink' =&gt; "checkbox|propre|Redirect article to Hyperlink?"
        )
    );

$GLOBALS['champs_extra_proposes'] = Array (
    'articles' =&gt; Array (
        'tous' =&gt; 'redirect_to_hyperlink',  
            '44' =&gt; $UpcomingEvent,
        '45' =&gt; array($UpcomingEvent, $ThermometerEvent),
</code></pre>

<p>and then:</p>

<p>this is where i added the loop</p>

<pre><code>        else if ($id_rubrique &amp;&amp; isset($GLOBALS['champs_extra_proposes'][$type][$id_rubrique])) {
            for ($i; $i&lt;2; $i++){
                $champs_proposes = explode('|', $GLOBALS['champs_extra_proposes'][$type][$id_rubrique][$i]);
                }
        }

    if($champs_proposes == explode('|', '')) $champs_proposes = Array();


    reset($champs_proposes);
    while (list(, $champ) = each($champs_proposes)) {
        $desc = $champs[$champ];
        list($form, $filtre, $prettyname, $choix, $valeurs) = explode("|", $desc);

        if (!$prettyname) $prettyname = ucfirst($champ);
        $affiche .= "&lt;b&gt;$prettyname&amp;nbsp;:&lt;/b&gt;&lt;br /&gt;";

        switch($form) {


            case "case":
            case "checkbox":
                $affiche = ereg_replace("&lt;br /&gt;$", "&amp;nbsp;", $affiche);
                $affiche .= "&lt;input type='hidden' name='suppl_$champ' value='1' /&gt;&lt;input type='checkbox' name='suppl_{$champ}_check'";
                if ($extra[$champ] == 'true')
                    $affiche .= " checked";
                    $affiche .= " /&gt;";
                break;

        $affiche .= "&lt;br /&gt;\n";
    }

    return $affiche;
}
</code></pre>

<p>So basically what I changed was that i made the 45 into an array that should have both the $upcomingevent and the $thermometerEvent variables (which it does) however when I iterate through the for loop it overwrites the variable (obviously) since it just sets the variable each time through the loop. I tried making the   $champs_proposes an array but I can't seem to do it correctly.</p>

<p>Any help is appreciated.</p>
