Little advice here:
- opening and reading your file: [man]file[/man] - it reads your file to an array (one line in one elemente of an array)
- then use [man]foreach[/man] to loop through all lines of your file, something like:
$file_arr = file('/path/to/yourfile.txt');
foreach ($file_arr as $line)
{
//do the parsing for one line here using $line
}
- parsing your line: [man]explode[/man] - does what it says 🙂 splits the string with a delimiter
list($dummy1, $dummy2,$code,$description,$number,$dummy3) = explode("|",$line);
//I'm not sure if $dummy1 and $dummy3 are necessary
- when you have the info for one line, insert it to the database. Read about it, for example here: [man]mysql[/man] if you don't know how to handle SQL statements, find some tutorial on mysql and php (use google).