Re: Create Array?? More

From: Date: Sun, 23 Sep 2001 07:16:14 +0000
Subject: Re: Create Array?? More
Groups: php.general 
Request: Send a blank email to php-general+get-68404@lists.php.net to get a copy of this message
Ok, Thanks for the input, unfortunately it didn't help me solve my overall problem, so I will post that and see if anyone has any suggestions... I am basically displaying the Usernames from a .htpasswd file like this... $File="$Path$Directory1/.htpasswd"; $fd = fopen ($File, "r"); $Content = fread ($fd, filesize ($File)); $Content=ereg_replace ("\n",":", $Content); // Explode the file using : as seperator $MyContent = explode (":", $Content); // Count it up $LoU = count($MyContent)-1; // Close the File fclose($fd); for ($a=0; $a < $LoU; $a+=2) { printf("\n<TD>%s</TD>%s<TD></TD>", $MyContent[$a], $MyContent[$a+=2]); } This is working perfectly, but what I would like to do is display a number next to each one, at the moment it displays... UserName1 UserName2 UserName3 UserName4 What I would like it to do is 1. UserName1 2. UserName2 3. UserName3 4. UserName4 I cannot figure a way to use $a because it has to skip by 2 in order not to display the encrypted passwords..any suggestions??? TIA Ade

« previous php.general (#68404) next »