justus Posted March 23, 2004 Report Posted March 23, 2004 skripts kas ielasa datus no faila un no katras rindinjas izveido masiivu, un sadala rindu masiiva elementos, paarbaudiiju errorus neizmet. <?php <? $f=fopen("fails.txt","r"); while($r=fgets($f,499900)){ $dati[$i]=explode(";",trim($r)); unset($dati[$i][sizeof($dati[$i])]); } fclose($f); bet laukaa taas veertiibas es nekaadiigi nevaru izvadiit meegnaaju visaaadi: $saturs=$dati [0][1]; echo ("$saturs"); nekaadiigi nesanaak. :( :( :( :( :( :( :( :( :( :( :(
Aleksejs Posted March 23, 2004 Report Posted March 23, 2004 (edited) Es kaut kā nevaru iebraukt rindiņas: unset($dati[$i][sizeof($dati[$i])]); funkcionālajā jēgā... Kas tur tiek darīts (cerēts, ka notiek ;) ) Pieļauju arī, ka $i kaut kur tiek piešķirta vērtība. Edited March 23, 2004 by Aleksejs
justus Posted March 23, 2004 Author Report Posted March 23, 2004 <?php $fails = file('fails.txt'); for ($i=0;$i<=count($fails);$i++) { $masivs[$i] = explode (";",$fails[$i]); } ?> arii ar shito man nesanaak esmu izmisumaa
rnc Posted March 23, 2004 Report Posted March 23, 2004 <?php $fails = file('fails.txt'); for ($i=0;$i<=count($fails);$i++) { $buu = explode(";",$fails[$i]); echo "<h2>$buu[0]</h2><br>\n"; echo "<h3>$buu[1]</h3><br>\n"; echo "<h5>$buu[2]</h5></br>\n"; echo "-----------------------<br>\n"; } ?>
Recommended Posts