Raiviic Posted November 11, 2005 Author Report Share Posted November 11, 2005 es traks ar shito - nekas man tur neiet - izskatas taaa <? for($i=1;$i<=file_get_contents("formas/rskaits.txt");$i++) { $content=file_get_contents("raksts".$i.".php"); while ($val=each($content)){ $tmp=explode(":",$val[3]); echo $tmp[0]; echo $tmp[1]; echo $tmp[2]; echo $tmp[3]; } } ? nu tachu jabut kadam kas man var pateikt kas shitaja arprata ir nepareizs, kludu izmet shitadu - Warning: Variable passed to each() is not an array or object Link to comment Share on other sites More sharing options...
bubu Posted November 11, 2005 Report Share Posted November 11, 2005 (edited) Jopcig, tu dokumentāciju lasi vai nē, ka nezini ko dara each() un ko dara file_get_contents(). Par vēl vienu muļķīgu postu tavu te, kura atbilde rodama dokumentācijā, topiks ceļos uz Drazu. Edited November 11, 2005 by bubu Link to comment Share on other sites More sharing options...
Raiviic Posted November 11, 2005 Author Report Share Posted November 11, 2005 nu dzeki sorry - varat tad varbut linku vai pastastit man - nevis uzreiz taa - es saprotu ka neesmu guru shitaja un visu parasti pats atrodu un izdaru bet nu sorry shoreiz man nesanak pasham Link to comment Share on other sites More sharing options...
php_Stopp Posted November 11, 2005 Report Share Posted November 11, 2005 (edited) varbūt iekopē to manu pirmo uzrakstīto kodu un, ja tu no tā raksta faila izvadi visus datus, tad otro variantu tam kodam - ar foreach() lai tu neputrotos, uzrakstīšu pilnu to kodu: <?php for($i=1;$i<=file_get_contents("rskaits.txt");$i++) { $expl = explode(":", file_get_contents("raksts".$i.".php"); foreach($expl as $dala_datu) echo $dala_datu; } ?> vai arī izvadi katru array sastāvdaļu atsevišķi (tas ir labāk, kad formē dizainu): <?php for($i=1;$i<=file_get_contents("rskaits.txt");$i++) { $expl = explode(":", file_get_contents("raksts".$i.".php"); echo $expl['0']; echo $expl['1']; echo $expl['2']; echo $expl['3']; } ?> abi šie kodi dos vienu un to pašu rezultātu Edited November 11, 2005 by php_Stopp Link to comment Share on other sites More sharing options...
Raiviic Posted November 11, 2005 Author Report Share Posted November 11, 2005 viss smuki izvadas no visiem failiem pec kartas - es zinu ka shoreiz jus tochna mani lamasies - man nesanak explode uztaisit un vajag lai izvadas dilstosha seciba tas viss attiecigi 3 raksts 1mais 2 raksts 2ais un 1 raksts 3shais ok par to dilstoshu secibu uztaisiju bet vel tas explode man negrib stradat ...... Link to comment Share on other sites More sharing options...
Raiviic Posted November 11, 2005 Author Report Share Posted November 11, 2005 ... paldies par jusu palidzibu, es visu uzrakstiju un izdariju pats, man viss aizgaja Link to comment Share on other sites More sharing options...
php_Stopp Posted November 11, 2005 Report Share Posted November 11, 2005 nu jā, sorry, man vienmēr (arī tad, kad pats raktu kodus) aizmirstas beigās pie explode, if utt. beigās piekabināt to vienu iekavu.. Link to comment Share on other sites More sharing options...
Raiviic Posted November 11, 2005 Author Report Share Posted November 11, 2005 taa nav problema ka sintakse biku nepareize man pati ta sistema nebija skaidra - bet tagad uz kadu laiku viss bus ok kamer atkal nesadomashu savas spidoshas idejas kuraaas pats netieku skaidrs ka to izdarit :) Link to comment Share on other sites More sharing options...
Recommended Posts