// in globals.inc
$table_header[] = "Name";
$table_header[] = "Email".$myemail;
$table_header[] = "Telno";
// in functions.inc
function PrintTableHeader($table_header_array,$myemail_forthis)
{
for ($i=0;$i<count($table_header);$i++)
{
output .= "<th>".$table_header[$i]."</th>"
}
return $output;
}
// in product.php3
$myemail = "mail@peterbe.com";
echo PrintTableHeader($table_header,$myemail);
This works fine except the $myemail variable isn't printed with the other items in the $table_header array.
The order in which these docs are rendered is this:
1) global.inc
2) functions.inc
3) product.php3 // the current doc
When the $table_header array is created in global.inc the variable $myemail doesn't exist yet. Not until the function is called.
How do I do so that the function passes the $table_header array a variable that I can use IN the function?
(At the moment, nothing happens to the $myemail variable.)