<?php
$myfield = " ";
$myfield = trim($myfield);
if (!$myfield) {
echo 'Field is empty';
} else {
echo 'Field is NOT empty';
}
?>
Try trimming, then assigning it back to the same variable, then testing to see if its false.. like i did above: if(!$myfield) { }
Ok? I tested this code, and it does work. 🙂