Erglis Posted April 25, 2006 Report Share Posted April 25, 2006 Sveiki, Atnācu pie jums ar mazu lūgumu. Varbūt arī pēc skriptiņa ja būsat tik laipni ! mana web folderi atrodas piem. dokuments.txt kuru es gribētu atēlot web'a.. dokuments.txt saturs ir top15 un izskatas šādi: X "Erglis" 3 19 50 0 X "[b-TeaM] Tr!x*" 3 45 80 17 X "Erglis" 4 14 20 0 X "[b-TeaM] Tr!x*" 4 58 20 33 X "[b-TeaM] Mc" 7 24 80 10 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 Gala rezultāts: Niks Laiks CP 1)Erglis 3:19:50 0 2)[b-TeaM] Tr!x* 3:45:80 17 3)Erglis 4:14:20 10 4)[b-TeaM] Tr!x* 4:58:20 33 5)[b-TeaM] Mc 7:24:80 10 Tops tiek papildināts automatiski un vietas var mainiities... Link to comment Share on other sites More sharing options...
GedroX Posted April 25, 2006 Report Share Posted April 25, 2006 Tu pēc kā jautā? Skripta rezultātu attēlošanai/ ierakstīšanai/ abiem? Link to comment Share on other sites More sharing options...
Vebers Posted April 25, 2006 Report Share Posted April 25, 2006 $saturs=file('dokuments.txt'); for($i=0;$i<count($saturs);$i++) { $rinda=explode(' ', trim($saturs[$i])); $vieta=$i+1; echo $vieta.')'.str_replace('"', '', $rinda[1]).' '.$rinda[2].':'.$rinda[3].':'.$rinda[4].' '.$rinda[5].'<br />'; } Link to comment Share on other sites More sharing options...
GedroX Posted April 25, 2006 Report Share Posted April 25, 2006 Nolasīšanai precīzāk būtu $file = file('dokuments.txt'); $data = Array(); $i = 0; foreach($file as $key => $value) { $value = explode('"', $value); if (count($value) != 3) { continue; } $value['Niks'] = $value[1]; if ($value['Niks'] == 'X') continue; $value[2] = explode(' ', trim($value[2])); $value['Laiks'] = $value[2][0] . ':' . $value[2][1] . ':' . $value[2][2]; $value['CP'] = $value[2]; $i++; echo $i . ') ' . $value['Niks'] . ' ' . $value['Laiks'] . ' ' . $value['CP']; } Link to comment Share on other sites More sharing options...
Delfins Posted April 25, 2006 Report Share Posted April 25, 2006 Ar pregu smukāk būs... /\"(.+?)\"\s([\d])\s([\d])\s([\d])\s([\d])/ \s vai \S neatceros, manuālī paskaties... Link to comment Share on other sites More sharing options...
Erglis Posted April 25, 2006 Author Report Share Posted April 25, 2006 Ar pregu smukāk būs... /\"(.+?)\"\s([\d])\s([\d])\s([\d])\s([\d])/ \s vai \S neatceros, manuālī paskaties... ja veel kko no taa prega saprastu :P kur tas jaaraxta ieksaa??? :? un paldies GedroX`am un MakaTaNaw... Link to comment Share on other sites More sharing options...
GedroX Posted April 25, 2006 Report Share Posted April 25, 2006 Laikam kautkā tā: <?php $file = file('dokuments.txt'); $data = Array(); $i = 0; foreach($file as $key => $value) { $value = trim($value); $value = preg_replace('/^X "X" .*$/', '', $value); if (preg_match('/^X "(.+)" (\d+) (\d+) (\d+) (\d+)$/', $value)) { $i++; echo preg_replace('/^X "(.+)" (\d+) (\d+) (\d+) (\d+)$/', $i . ') $1 $2:$3:$4 $5', $value) . '<br />'; } } ?> Link to comment Share on other sites More sharing options...
Erglis Posted April 25, 2006 Author Report Share Posted April 25, 2006 GedroX , hmm interesanti un pie tam straadaa !! paldies !! te buutu vispareejais sapnu variants - http://83.223.147.4/rez.jpg +naak bilde zem bildes nosaukums.. tabulina(navobligati) un domaju numeraaciju atmest vai var luugt ? Link to comment Share on other sites More sharing options...
Vebers Posted April 25, 2006 Report Share Posted April 25, 2006 Un kur problēmas? Atlicis tikai tirākais html. Link to comment Share on other sites More sharing options...
Erglis Posted April 25, 2006 Author Report Share Posted April 25, 2006 Un kur problēmas? Atlicis tikai tirākais html. lab paldies par to pasu meginasu kka uztaisiit !! Link to comment Share on other sites More sharing options...
ricshs Posted April 25, 2006 Report Share Posted April 25, 2006 tev to cs`a vajadzēja? un ja tā, tad kā to grasies pielietot? Link to comment Share on other sites More sharing options...
Erglis Posted April 25, 2006 Author Report Share Posted April 25, 2006 tev to cs`a vajadzēja? un ja tā, tad kā to grasies pielietot? ja joprojam nekas nesanaak ... buutu jauki sanemt kadu paliidziibu :) Link to comment Share on other sites More sharing options...
ricshs Posted April 26, 2006 Report Share Posted April 26, 2006 a kā tu domā to pielietot vari paskaidrot, mani ieintrģēji :) Link to comment Share on other sites More sharing options...
Erglis Posted April 27, 2006 Author Report Share Posted April 27, 2006 a kā tu domā to pielietot vari paskaidrot, mani ieintrģēji :) nu ir taada jauka lietinja kaa top15 :))))) vnk gribaas kreedz serverim mazu topinju ne tikai ieksh cs servera, bet arii web lapinjaa... :) buusju ljoooti prieciigs ja kaads paliidzeees, bet nu meeginaasju kko arii pats burt... tikai nesanaak =/ Link to comment Share on other sites More sharing options...
ricshs Posted April 27, 2006 Report Share Posted April 27, 2006 Zinu, ka ir top15, bet kur tur var dabūt šādu: X "Erglis" 3 19 50 0 X "[b-TeaM] Tr!x*" 3 45 80 17 X "Erglis" 4 14 20 0 X "[b-TeaM] Tr!x*" 4 58 20 33 X "[b-TeaM] Mc" 7 24 80 10 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 Pasaki, būšu ļoti pateicīgs, jo man sanāca ar taviem skaitļiem kko sakinīt, bet kur tu rauji šos skaitļus, kurā mapē X "Erglis" 3 19 50 0 X "[b-TeaM] Tr!x*" 3 45 80 17 X "Erglis" 4 14 20 0 X "[b-TeaM] Tr!x*" 4 58 20 33 X "[b-TeaM] Mc" 7 24 80 10 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 X "X" 9999999 0 0 9999999 Link to comment Share on other sites More sharing options...
Recommended Posts