Använd empty() och/eller is_null()
https://www.php.net/empty https://www.php.net/is_null
Enbart tom kommer att uppnå din nuvarande användning, is_null skulle bara göra mer kontroll möjlig om du ville skilja mellan ett fält som är null och ett fält som är tomt.