';
foreach($file as $entry) {
if (stripos($entry, $_GET['search']) !== false) {
echo $entry.'
';
}
}
} else{
$file = file('words.txt', FILE_IGNORE_NEW_LINES);
$op = $ol = array();
$check = $_GET['check'];
if (empty($check)) $check = 'A-FXYMO';
foreach($file as $entry) {
//if (preg_match('/^['.$check.']{4,}$/i', $entry)) {
if (preg_match('/(.*?t.*?){3}/i', $entry) && preg_match('/(.*?n.*?){3}/i', $entry)) {
$op[] = $entry;
$ol[] = strlen($entry);
}
}
asort($ol);
foreach ($ol as $key => $entry) {
echo $op[$key].'
';
}
}
?>