anonīms Posted September 11, 2008 Report Share Posted September 11, 2008 Tātad ir tabula, kura ir no while. ____________________ |_|_____Augusts______| |_|__________Harals__| |_|_____Pēteris__ ____| |_|____Jūlija_________| |_|______Juris_______| |_|__________Asvalts_| |_|____Kirils_________| |_|____Bergmanis____| un gribu izveidot, lai viņiem būtu katram savs cipars dilstošā secībā. |1|_____Augusts______| |2|__________Harals__| |3|_____Pēteris__ ____| |4|____Jūlija_________| |5|______Juris_______| |6|__________Asvalts_| |7|____Kirils_________| |8|____Bergmanis____| Kā to varētu panākt? Link to comment Share on other sites More sharing options...
john.brown Posted September 11, 2008 Report Share Posted September 11, 2008 Nu kaut kā tā, droši vien: $i = 1; while($item = array_shift($items)) { echo $i, '|', $item; $i++; } Link to comment Share on other sites More sharing options...
anonīms Posted September 12, 2008 Author Report Share Posted September 12, 2008 Aha $i = 1; while(...) { echo $i++; } Link to comment Share on other sites More sharing options...
Recommended Posts