Ja, priporočam, ajpes.
$content = file_get_contents('ajpes_txt_datoteka_potegni_dol_iz_strani.txt', true);
$lines = explode("\n", $content);
foreach ($lines as $line){
try{
if (!empty($line)){
$lineData = array();
if(iconv('WINDOWS-1250', 'UTF-8', substr($line, 2, 1) == '*')) {
$lineData['taxpayer'] = 1;
}else{
$lineData['taxpayer'] = 0;
}
$lineData['tax_number'] = iconv('WINDOWS-1250', 'UTF-8', substr($line, 4, 8));
$lineData['name'] = trim(iconv('WINDOWS-1250', 'UTF-8',substr($line, 42, 101)));
$lineData['address'] = trim(iconv('WINDOWS-1250', 'UTF-8',substr($line, 143, 114)));
// RM: Insertej v MYSQL kakor želiš
insertAjpes_DB($lineData['name'], $lineData['tax_number'], $lineData['address'], $lineData['taxpayer']);
}
} catch (Exception $e){
echo 'error'; exit;
}
}