Is there a way to cycle through all the variables posted from a form, and then put a comma between all the values??
thanx
| SitePoint Sponsor |




Is there a way to cycle through all the variables posted from a form, and then put a comma between all the values??
thanx





Is this what you are after?PHP Code:$str = implode(",",$HTTP_POST_VARS);
Please don't PM me with questions.
Use the forums, that is what they are here for.




is it possible to get the names of the variables too? so it would look like this
"varibale name: value, varibale name: value" ect...
the variable name comes from the name's of the fields in the from from the previous page





PHP Code:$string = '';
while (list($key, $value) = each($HTTP_POST_VARS))
$string .= "$key: $value, ";
// Now knock off the last two characters which will be an unwanted ', '
$string = substr($string, 0, -2);
Bookmarks