The function below is working fine, but not returning the value for only the variable $field in the string given to $reslt:
function req($slice,$field)
{
if ($slice == "") {
$reslt = $field. ' cannot be empty<br />';
return $reslt;
}else{
$reslt = "";
return $reslt;
}
}
req($slice,$field);
$err_mess = req();
echo $err_mess; // gives me 'cannot be empty' as result but does not show the value for the '$field' variable included in the string