- Code: Select all
//the output
if ($HTTP_GET_VARS){
$i = 0;
foreach($HTTP_GET_VARS as $v) {
print "var$i = $v <br>";
$i++;
}
}else{
//the link
$a = array(1 => 'number_one', 2 => 'number_two', 3 => 'number_three');
echo "<a href='".$php_self."?";//the begining of the html link
//lets slice the array into variables
$i = 0;
foreach($a as $v) {
print "var$i=$v";
$i++;
if ( $i != sizeof($a) ) { echo "&"; }
}
echo "'>pass the array</a>";//the end of the html link
}
It works just nice


