Jeffreyv1987
09-22-2009, 10:13 PM
I need help.... Ugh Alright ive got this code
<?php
if ($handle = opendir('./')) {
while (false !== ($file = readdir($handle))) {
$filesplit = explode(".", $file);
$check = $filesplit[0];
$keyword=$_GET['search'];
if(ereg($keyword, $check))
{
$check .= ".$filesplit[1]";
$valid[] = $check;
}
}
echo "Search Term: <i>$keyword</i> - <BR>";
for($index = 0; $index < count($valid); $index++)
{
echo"<font size=2> <A href='$valid[$index]'>$valid[$index]</a></font><BR>";
}
closedir($handle);
}
?>
What this does is it searches my directory for what ever keyword is put in but..
If i have an item in my directory called " Music " and i type in " music " with a lower case m nothing shows, so how would i make it non case sensitive?
That way i can look up Music or music and it'll show.
<?php
if ($handle = opendir('./')) {
while (false !== ($file = readdir($handle))) {
$filesplit = explode(".", $file);
$check = $filesplit[0];
$keyword=$_GET['search'];
if(ereg($keyword, $check))
{
$check .= ".$filesplit[1]";
$valid[] = $check;
}
}
echo "Search Term: <i>$keyword</i> - <BR>";
for($index = 0; $index < count($valid); $index++)
{
echo"<font size=2> <A href='$valid[$index]'>$valid[$index]</a></font><BR>";
}
closedir($handle);
}
?>
What this does is it searches my directory for what ever keyword is put in but..
If i have an item in my directory called " Music " and i type in " music " with a lower case m nothing shows, so how would i make it non case sensitive?
That way i can look up Music or music and it'll show.