0 if (strlen($entered) > 0) { $hint = ""; for($i = 0; $i < count($names); $i++) { if ($entered == strtolower(substr($names[$i], 0, strlen($entered)))) { if ($hint == "") { $hint = $names[$i]; } else { $hint = $hint . " , " . $names[$i]; } } } } // Set output to "no suggestion" if no hints were found, // otherwise to the correct values if ($hint == "") { $response="no suggestion"; } else { $response=$hint; } //output the response echo $response; ?>