\n"; ++$errorCount; } function wordCheck($data, $fieldName) { if (empty($data)) { DisplayError($fieldName, "Please enter $fieldName"); $retval = ""; } else { return $data; } } if ($errorCount>0) { echo "Please re-enter data.
\n"; } else{ $filename = "file.txt"; $fp = fopen($filename, "w+"); $output =array("$lname , $fname , $addr , $cty , $stat , $zip , $acode - $phone"); } asort($output); foreach($output as $directory){ echo "$directory"; } ?>