RES: [PHP] array loops

From: Date: Fri, 01 Dec 2000 15:28:01 +0000
Subject: RES: [PHP] array loops
Groups: php.general 
Request: Send a blank email to php-general+get-28203@lists.php.net to get a copy of this message
try using the module function in the index of the array. like this. the code is in c++ chat * v [SIZE]; // array int i; // array index i=0; while (1) { printf("Index: %d; Value: %d", i, v[i]); i = ++i % SIZE; // increment of the index. observe the sequence sum before module } hop this helps -----Mensagem original----- De: Matt Williams [mailto:matt@yewlands.com] Enviada em: sexta-feira, 1 de dezembro de 2000 11:05 Para: php-general@lists.php.net Assunto: [PHP] array loops Hi I hope someone will be able to help with my mental block. I am pulling some details from the db and putting these into a table. I want each row to alternate the background color. I have a while loop printing out the db results and 2 background colors in a an array, so I need it print each of the colors, then start again till there are no more results. I can't seem to work it out trhough. Any help will be gratefully received M@ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#28203) next »