Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opendir - sorting alphabetically

Status
Not open for further replies.

Aeros

Programmer
Joined
Oct 7, 2002
Messages
166
Location
US
Is it possible to order the results of an opendir function alphabetically?

<select name=&quot;varProdImage&quot;>
<? $prodImages = opendir(&quot;../productImages/ProductFullsize&quot;);
while($M_prodImages = readdir($prodImages))
{
print(&quot;<option value=$M_prodImages>$M_prodImages</option>&quot;);
} ?>
</select>
 
store all the values into an array first and then use one of the sort() functions that matches your needs

Bastien

Any one have a techie job in Toronto, I need to work...being laid off sucks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top