Hello.
I have a library file of functions that are housed in say, a file called 'library_fcns.inc'.
Inside of this library file, there is a function that is to resolve the $HTTP_POST_VARS into their respective vars to use in the main program file.
The routine inside of the library file and is called via a 'require' statement in the main program by the statement 'require("library_fcns.inc") is:
function array_resolution($HTTP_POST_VARS)
{
// Resolving Array vars for use in other parts of program
foreach ( $HTTP_POST_VARS as $key=>$value )
{
if ( gettype( $value ) == "array" )
{
foreach ( $value as $two_dim_value )
print "$key == $two_dim_value<br>\n";
if ($key)
{
$$key = "$two_dim_value";
}
}
else
{
// This print statement is to print info to screen
print "$key == $value<BR>\n";
}
}
}
In addition to printing $$key to the screen, I want EACH $$key as the var to be passed from the function to the main program file for use in the rest of the routing; for example, after the 'require("...")' statement in the main program, I want to print the value of a selected $key of my choice. The only value that is printed is the last $$key which is the 'name' of the 'submit button' as '$Submit'.
How can I pass each $$key as it is resolved back to the main program to use wherever I want?
Thanks.
Sherry