Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Lionsanime Directory   ClickBooth Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 02-10-2007, 04:56 AM   #1 (permalink)
Inactive
 
Join Date: 02-10-07
Posts: 9
iTrader: 0 / 0%
Latest Blog:
None

unbound is liked by many
PHP: going through all possible combinations

How can I go through all possible combinations from A to Z with f.e. 4 letters? It should print something like this:

aaaa
aaab
aaac
aaad
aaae

etc.

So how can I do this with PHP? Or is it even possible?
unbound is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 02-10-2007, 05:39 AM   #2 (permalink)
Contributing Member
 
Join Date: 07-22-06
Location: Denver, Colorado, USA
Posts: 495
iTrader: 0 / 0%
Latest Blog:
None

jumpenjuhosaphat is just really nicejumpenjuhosaphat is just really nicejumpenjuhosaphat is just really nicejumpenjuhosaphat is just really nicejumpenjuhosaphat is just really nicejumpenjuhosaphat is just really nicejumpenjuhosaphat is just really nicejumpenjuhosaphat is just really nicejumpenjuhosaphat is just really nicejumpenjuhosaphat is just really nicejumpenjuhosaphat is just really nice
Sure it's possible, one way to do it, probably the simplest, is to nest 4 loops.

Code:
for($a=97; $a<123; $a++){ for($b=97; $b<123; $b++){ for($c=97; $c<123; $c++){ for($d=97; $d<123; $d++) { echo chr($a).chr($b).chr($c).chr($d); }}}}
jumpenjuhosaphat is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-10-2007, 06:58 AM   #3 (permalink)
Inactive
 
Join Date: 02-10-07
Posts: 9
iTrader: 0 / 0%
Latest Blog:
None

unbound is liked by many
Okay, thanks.
unbound is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Word Combinations And The Copyright Or Trademark Issues bermuda Legal Issues 0 09-02-2007 03:24 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 11:07 AM.
© Copyright 2008 V7 Inc