-
    ~
Advanced Hosters -

adamant
V.I.P.
: 20.03.2008
: 11504
# : Dec 01, 2010 6:40 am

$keyword = "";

keywords.txt

1
2
3
4
...
n
EvaPharmacy. , ! Jabber: [email protected] ICQ: 750000
Unlimited on 1Gbs port |

SpoNsoR
: 28.10.2008
: 928
Contest (: 1)
# : Dec 01, 2010 10:00 am
<?php

$filesource = "keyWords.txt";
$fp = fopen ($filesource, "r");

$storeWord = array();

if ($fp)
{ $i = 0;
while (!feof($fp))
{
/**********************************
get the list of words to find and
store them in an array for later use
**********************************/
$line = fgets ($fp, 100);
$storeWord[$i] = $line;

$i = $i+1;

}

fclose($fp);
}
else
echo "File could not be found";


/**********************************
open the text source file, pick each line
and compare it to the complete list of key words
**********************************/
$filesource = "textOrigin.txt";
$fp = fopen ($filesource, "r");
if ($fp)
{ $i = 1; //this is the line number
while (!feof($fp))
{


$textLine = fgets ($fp, 300);


/**********************************
compare all the words stored in the array
with each line in the origin file
**********************************/
for($n=0; $n<=count($storeWord)-1; $n=$n+1)
{
$pos = strpos($textLine, $storeWord[$n]);
if ($pos)
{
echo " line $i: $storeWord[$n]\n";
}
$i = $i+1;
}

}

fclose($fp);
}
else
echo "File could not be found";


?>

?
| - | | . r5

traffrush
: 03.12.2009
: 9
# : Dec 01, 2010 10:33 am

,
:

<?php
   define("KEYWORDS_FILE", "keywords.txt"); //
   $keywords = file(KEYWORDS_FILE, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)
      or die("Cannot load keywords");
   $keyword = $keywords[array_rand($keywords)];
   echo $keyword;
?>


adamant
V.I.P.
: 20.03.2008
: 11504
# : Dec 01, 2010 10:45 am
, ""
EvaPharmacy. , ! Jabber: [email protected] ICQ: 750000
Unlimited on 1Gbs port |
    ~