Lo probe asi pero siempre me marca el error :S
Cita: <?
if ( !empty($_POST['aceptar']) ) {
$vector = array('abc','def','ghi');
foreach ($vector as $letra) {
if ( !empty($_POST[$$letra]) ) $$letra = $_POST[$$letra];
if ( empty($$letra) ) $error[$$letra] = 'Es obligatorio completar el campo';
echo $error[$$letra];
}
}
?>
<form method="post" action="">
<input name="abc" /><br/>
<input name="def" /><br/>
<input name="ghi" /><br/>
<input type="submit" name="aceptar" />
</form>