| Current Path : /var/www/html/mmishra/indem/ |
| Current File : /var/www/html/mmishra/indem/read-file.php |
<?php
include "db.php";
dbConnect();
$file = "Glossaryxx.txt";
$handle = fopen ($file, 'r+');
while (!feof ($handle)) {
$line = fgets($handle);
$i++;
$term = explode(':', $line);
$def = str_replace("\n","", $term[1]);
echo $i . '- ' . $term[0] . ': ' . $def . "\n";
mysql_query("insert into glossary values(NULL,'".$term[0]."','$def','indem','172.31.2.4',now())");
}
fclose($handle);
?>