I have two arrays:
$fields_data
, which outputs:
Array ( [name] => [email] => [phone] => [message] => )
and $required_fields_array
, which outputs:
Array ( [0] => name [1] => email [2] => message )
The values of $required_fields_array
, are items in the $fields_data array
.
I need to check each of the $required_fields_array
against the $fields_data
to check if the array item they correspond to is empty.
I have tried:
foreach( $required_fields_array as $key )
{
if ( isset($fields_data[$key]) === false && empty($fields_data[$key]) === true )
{
print_r('empty');
}
}
I can't see why the above isn't working.
Can anyone please point me in the right direction.