Forum Moderators: coopster

Message Too Old, No Replies

Assigning values to a variable separated by comas

Assigning values to a variable separated by comas

         

Mitch888

6:19 pm on Mar 6, 2003 (gmt 0)

10+ Year Member



I have a form with five text fields that gets sent to another php page for handling. What I need is to assign all five values ($w_nbrs1, $w_nbrs2, $w_nbrs3, $w_nbrs4, $w_nbrs5) from the form to a single variable ($w_nbrs). How do I do that?

that did not work.
$w_nbrs = echo "$w_nbrs1,$w_nbrs2,$w_nbrs3,$w_nbrs4,$w_nbrs5";

please help

thank you

jarboy

6:41 pm on Mar 6, 2003 (gmt 0)

10+ Year Member



$w_nbrs = $w_nbrs1 . $w_nbrs2 . $w_nbrs3 . $w_nbrs4 . $w_nbrs5 ;

or if you want a delimiter between them (say a comma ,)

$w_nbrs = $w_nbrs1 . "," . $w_nbrs2 . "," . $w_nbrs3 . "," . $w_nbrs4 . "," . $w_nbrs5 ;

Mitch888

7:55 pm on Mar 6, 2003 (gmt 0)

10+ Year Member



it worked. thank you you are a life saver