<?php $row = array ('name'=>'martin','tel'=>null, 'experience'=> 'high','password'=>'','occupation'=>''); $missing_values = array_filter($row, function($value) { return $value == ''; }); $error = []; print_r($missing_values); foreach($missing_values as $k=>$v){ $error[$k] = "$k can't be empty"; } print_r($error);
You have javascript disabled. You will not be able to edit any code.