Use empty() instead of == '' for comparison.