neprasa Posted January 19, 2007 Report Share Posted January 19, 2007 piemeram ir viens aa un ka uzrakstit lai parada 100 aa katru sava rindā? Link to comment Share on other sites More sharing options...
Val Posted January 19, 2007 Report Share Posted January 19, 2007 <?php for($i=1;$i<=100;$i++) echo 'aa<br/>'; ?> Link to comment Share on other sites More sharing options...
neprasa Posted January 19, 2007 Author Report Share Posted January 19, 2007 for($i=1;$i<=100;$i++) $a = 'aa'; echo $a; parada tikai vienu aa un ka bez br rakstit lai butu katrs sava rinda? Link to comment Share on other sites More sharing options...
Val Posted January 19, 2007 Report Share Posted January 19, 2007 (edited) figūriekavas saliec vajadzīgajās vietās. <br/> vietā var lietot arī <p>aa</p> :D p.s. figūriekavas= { un } Edited January 19, 2007 by Val Link to comment Share on other sites More sharing options...
cilveks Posted January 19, 2007 Report Share Posted January 19, 2007 Paraada tikai vienu "aa", jo cikls tur ar vienkaarshi beidzas pirms "aa" izvades uz ekraana. for($i=1;$i<=100;$i++) $a = 'aa'; <--cikls beidzas sheit. echo $a; Buutu pareizaak shaadi: for($i=1;$i<=100;$i++) { $a = 'aa'; echo $a; } Un veel, nevajag tev $a veertiibu katru reizi ciklaa paarpieskhkjirt, taas ir tikai liekas darbiibas, lieka noslodze, shoreiz ta siikums, bet kaadreiz arii siikumiem ir noziime:). Iznes $a veertiibas pieskjirshanu aarpus cikla (pirms), ja tev cikla laikaa mainiitos $a veertiiba, tad cita runa. Link to comment Share on other sites More sharing options...
neprasa Posted January 19, 2007 Author Report Share Posted January 19, 2007 ko kur likt? a nevar kautka ar \n gribu lai vispar neredz ne br ne <p> Link to comment Share on other sites More sharing options...
cilveks Posted January 19, 2007 Report Share Posted January 19, 2007 (edited) Paraada tikai vienu "aa", jo cikls tur ar vienkaarshi beidzas pirms "aa" izvades uz ekraana. for($i=1;$i<=100;$i++) $a = 'aa'; <--cikls beidzas sheit. echo $a; Buutu pareizaak shaadi: for($i=1;$i<=100;$i++) { $a = 'aa'; echo $a; } Un veel, nevajag tev $a veertiibu katru reizi ciklaa paarpieskhkjirt, taas ir tikai liekas darbiibas, lieka noslodze, shoreiz ta siikums, bet kaadreiz arii siikumiem ir noziime:). Iznes $a veertiibas pieskjirshanu aarpus cikla (pirms), ja tev cikla laikaa mainiitos $a veertiiba, tad cita runa. $a = 'aa'; for($i=1;$i<=100;$i++) { echo $a; } edit: sagljukojaas, luudzu izdzeest vienu manu komentaaru, man pasham nav taadas iespeejas. Edited January 19, 2007 by cilveks Link to comment Share on other sites More sharing options...
Val Posted January 19, 2007 Report Share Posted January 19, 2007 a nevar kautka ar \n gribu lai vispar neredz ne br ne <p> A nevar izvadīt visu, ko vajag, neko nerakstot? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted January 19, 2007 Report Share Posted January 19, 2007 (edited) cilveks --> nafig tur vispaar vajadziigs mainiigais???? Val --> starpcitu var gan iztikt bez <br><p> tagiem :) tam domaats <pre></pre> Vienkarshi lai izvadiito kautko bez echo ir arii citas iespejas... print() printf() utt... saja gadijumaa.. <pre> <?php for($i=1;$i<100;$i++) { printf("aa\n"); } ?> </pre> Edited January 19, 2007 by Grey_Wolf Link to comment Share on other sites More sharing options...
cilveks Posted January 19, 2007 Report Share Posted January 19, 2007 (edited) Grey_wolf: ej nu sazini kas topika autoram padomaa, es jau nezinu kaads ir paareejais kods, tas bija tik piemeers. P.S. vadiijos peec treshaa posta shajaa forumaa. Edited January 19, 2007 by cilveks Link to comment Share on other sites More sharing options...
Val Posted January 19, 2007 Report Share Posted January 19, 2007 Grey_Wolf: konkrētajā gadījumā nav jēgas neko sarežģīt, jo autoram jau problēmas sagādā pats vienkāršākais variants. Link to comment Share on other sites More sharing options...
Stopp Posted January 19, 2007 Report Share Posted January 19, 2007 Kā mani fascinē fakts, ka šai te forumā šāda tēma tiek diezgan aktīvi apspriesta. :) Link to comment Share on other sites More sharing options...
Recommended Posts