function emptyzipcode($request) {
global $requestslimit,$postal1,$postal2,$postal3,$postal4,$postal5,$postal6,$postal7,$postal8,$postal9,$postal10;
$string = '(';
for ($x = $request+1; $x <= 9; $x++) {
$string = $string . '!empty($postal' . $x . ') or ';
}
$string = $string . '!empty($postal10))';
$postal='postal'. $request;
echo $string;
echo "<br/><br/>";
echo $$postal;
echo "<br/><br/>";
echo $postal2;
if (empty($$postal) and $$string){
echo '<h2><font color="red">Failed!</font></h2>';
echo '<h3>Request #' . $request . ' Zip Code Empty!</h3>';
exit();
}
}
I want to able to use the variable $string as a condition in the if statement; for example $string="(!empty($postal5) or !empty($postal6) or !empty($postal7) or !empty($postal8) or !empty($postal9) or !empty($postal10))"
Does anybody know how to do this? Thanks