[Discuss] php foreach variable variable post

Eric Chadbourne eric.chadbourne at gmail.com
Fri Dec 30 10:10:44 EST 2011


I have a list of columns being retrieved from a function,
select_groups(), as an array.

These are being using to dynamically generate a form.

The form is used post to another page for processing.

I want to generate the list of columns again, put those column names
into $_POST[] to get the values made by the user in the form.

Something like:

<?php

$my_array4 = select_groups("group");

foreach ($my_array4 as $v_element) {
$$_POST[$v_element['column_name']]=pg_escape_string(trim($_POST[$v_element['column_name']]));
}

?>

I know I'm close.  Any tips?

Thanks,
Eric



More information about the Discuss mailing list