Курсовая работа: Разработка сайта. Система поиска по сайту
$NotAllowed=" (";
for ($i=0; $i<$NotAllowedCount; $i++)
if ($i! = ($NotAllowedCount-1))
$NotAllowed. =$NotAllowedArray [0] [$i]. "|";
else
$NotAllowed. =$NotAllowedArray [0] [$i];
$NotAllowed. =")";
}
function DirSubscripting ($dir)
{
global $term_paper,$OpenData,$NotAllowed;
if (is_readable ($dir2=$dir))
{
$OpenDir=opendir ($dir);
while ( ($file=readdir ($OpenDir))! ==false)
{
if ($file! =". "&&$file! =". "&&! preg_match ("/". $NotAllowed. "/i",$file))
{
if (is_dir ($dir. chr (47). $file))
DirSubscripting ($dir. chr (47). $file);
else
{
$OpenFile=fopen ($dir. chr (47). $file,'r');
$content=fread ($OpenFile,filesize ($dir. chr (47). $file));
preg_match ("! <title> (. *) </title>! is",$content,$title);
$content=term_paper_strip_new_line (strip_tags ($content));
$content=preg_replace ("/ +/s"," ",$content);
preg_match_all ("/\w+/i",$content,$ContentArray);
if (! empty ($title [1]))