neo Posted March 11, 2008 Report Share Posted March 11, 2008 Iisti nevaru tikt galaa ar sekojoshu lietu: <? $a_1 = "tesksts 1"; $a_2 = "tesksts 2"; $a_3 = "tesksts 3"; for($i=1; $i<=3; $i++) { //taadad ir nepiecieshams uztaisiit mainiigo ar nosaukumu $a_ un klat pie shii mainiigaa nosaukuma pielikt $i vertiibu lai ciklam izpildoties izveidotos mainiigie $a_1 , $a_2, $a_3 } ?> Ceru ka izteicos pietiekami sakariigi. Link to comment Share on other sites More sharing options...
mounkuls Posted March 11, 2008 Report Share Posted March 11, 2008 (edited) Mainīgie jau ir. vieglak nav tā? $a=array('teksts 1','teksts 2','teksts 3'); for($i=0; $i<=2; $i++) { $output=$a[$i]; //tālāk dari ko gribi ar vērtību } Edited March 11, 2008 by mounkuls Link to comment Share on other sites More sharing options...
marrtins Posted March 11, 2008 Report Share Posted March 11, 2008 print ${"a_$i"} Link to comment Share on other sites More sharing options...
Recommended Posts