Mega Code Archive

 
Categories / Php / Strings
 

Combining trim() and strlen()

if (strlen(trim($_POST['name'])) == 0) {     $errors[] = "Your name is required."; }