ezs Posted July 6, 2004 Report Share Posted July 6, 2004 me jau mekleja bet neatrada risinajumu uz manu probu problema ir tada ir fails - fails.txt kura ir ieraxti aa bb cc dd etc me vajag lai samie tiktu izwadiiti ar while ciklu plus katram vel kaartas skaitlis [1]aa [2]bb utt me navar izdomaat ka to panaakt bet noteikti ir jabuut ciklam jo savaadaak tak to nevarees dabuut gatavu manualis arii loti skopi par visu fileopen etc stasta udzu paliidzat :blink: Link to comment Share on other sites More sharing options...
рпр Posted July 6, 2004 Report Share Posted July 6, 2004 nu tad tik lasi katra faila elementu lasi ieksh masiiva elementa, kameer ir \n, ja \n, tad nobeidz masiiva elementu un saac nakosho. ja tu pats gjeneree tos failus, tad padomaa vai eertaak nebuutu uzreuz gjenereet php failu, kur buus jau nodefineets gatavs masiiivs. <?php $masiivs[$i++] = 'aa'; $masiivs[$i++] = 'bb'; $masiivs[$i++] = 'cc'; // utt ?> Link to comment Share on other sites More sharing options...
Venom Posted July 6, 2004 Report Share Posted July 6, 2004 $izvads=file('dati.txt'); array_unshift($izvads,'neskaitaas'); $elementi=sizeof($izvads); $index=0; while(++$index<$elementi) echo $index.' '.$izvads[$index]; NB: $masiivs[$i++] = 'aa'; $masiivs[$i++] = 'bb'; $masiivs[$i++] = 'cc'; $masiivs[++$i] = 'aa'; $masiivs[] = 'bb'; $masiivs[] = 'cc'; Link to comment Share on other sites More sharing options...
Recommended Posts