simple array question (Am a Newbie kindly excuse.)

From: Date: Fri, 10 May 2002 09:18:43 +0000
Subject: simple array question (Am a Newbie kindly excuse.)
Groups: php.general 
Request: Send a blank email to php-general+get-96864@lists.php.net to get a copy of this message
Greetings my PHP people. Will do things a bit backwork code first and what i want as that seems the easiest way to explain Here is the code: <?php $a1[]="ryan1"; $a1[]="ryan1.2"; $a1[]="ryan2"; $a1[]="ryan2.1.1.1.1.1"; $a1[]="ryan3"; $a1[]="ryan3.2"; reset($a1); print("Tesing arrays:<br>"); while(list($aa1,$aa2) = each ($a1)) { print($aa2 . ",<br>"); } ?> Which gives out the output: Tesing arrays: ryan1, ryan1.2, ryan2, ryan2.1.1.1.1.1, ryan3, ryan3.2, my question/problem is simply this: how do i stop the last comma from coming? because originally instead of giving the output to the browser i want it to "feed" it to a hidden form field, which i enter into the database.... Yeah yeah yeah, wipe the tears of laugher from your eyes and remember, you too were once a newbie. :-o) This list is great and i know i will get not one answer but many, thank you in advance. -Ryan A.

« previous php.general (#96864) next »