lvspeedy Posted September 27, 2003 Report Share Posted September 27, 2003 Mana problema ir sada. Man vajag sadu tadu infu saglabat TXT failos, un ta, ka PHP to papildina, lai vins ieraksta jauna rindina, bet visu laiku tad merglis raksta talak. Nesaprotu es PHP enpareizi nokunfigurejis esmu vai? Ludzu palidziet Link to comment Share on other sites More sharing options...
Venom Posted September 27, 2003 Report Share Posted September 27, 2003 1) apskaties manuālī, kādu tev vajag otro fopen parametru (w - rakstīšana no jauna, r - lasīšana, a - pievienošanau utml); 2) php raksta tikai to, ko viņam liek un nepievieno jaunas rindas zīmi. Tev tas jādara pašam: fwrite($fp,"\n".$text); (atstarpe pirms teksta) vai atstarpe pēc teksta fwrite($fp,$text."\n"); "\n" ir tāds specālsimbols, kurš parasti nav redzams (ASCII CHAR #13), tu viņu redzēsi ja Wordā ieslēgsi tādu fīču uz paneļa. Vēl, vndovos rindas tiek pabeigtas ar "\r\n", linušos tikai ar "\n", makos varētu tikai ar "\r". Vēl ir "\t" - tabulācijas simbols. Link to comment Share on other sites More sharing options...
lvspeedy Posted September 27, 2003 Author Report Share Posted September 27, 2003 Es iedomajos, ka vainigs vel varetu but tas, ka es izveidoju to txt failu. Unicode, UTF-8 un visi tie parametri ari kaut ka pareizi janosaka? Link to comment Share on other sites More sharing options...
lvspeedy Posted September 27, 2003 Author Report Share Posted September 27, 2003 Man tomer nekas nesanak vins raksta visu laiku talak, bet text atdala ar kaut kadu tur kluci. Ludzu atsutiet man kadu piemeru uz manu e-pastu grinvalds_e@ezernet.lv Jau ierpeiks liels paldies Link to comment Share on other sites More sharing options...
Venom Posted September 27, 2003 Report Share Posted September 27, 2003 $rindas=array('pirmā','otrā','trešā'); $fp=fopen('fails.txt','a'); foreach($rindas as $rinda) { fwrite($fp,$rinda."\n"); } fclose($fp); A tu UTF-8 iekš faila raksti? Link to comment Share on other sites More sharing options...
lvspeedy Posted September 27, 2003 Author Report Share Posted September 27, 2003 Ne, kad taisa to failu TXT caur notepad, tad vins tur apaksa lauj izveleties tas rindas Link to comment Share on other sites More sharing options...
lvspeedy Posted September 27, 2003 Author Report Share Posted September 27, 2003 Pastieties ludzu varbut kods nav pareiz vai kaut kada fiska, jo man joprojam vins neraksta jauna rinda http://paste.php.lv/394 Link to comment Share on other sites More sharing options...
K|NG Posted September 27, 2003 Report Share Posted September 27, 2003 pmēģini kautkā šitā: http://paste.php.lv/395 ;) Link to comment Share on other sites More sharing options...
lvspeedy Posted September 29, 2003 Author Report Share Posted September 29, 2003 OK paldies tev KING :rolleyes: :rolleyes: :rolleyes: Link to comment Share on other sites More sharing options...
Recommended Posts