Unstoppable Domains

Phone Number Combination Script!

Spaceship Spaceship
Watch

p0iz

Established Member
Impact
3
I'm looking for a script for a potential site I might be making. I really only need an example code. This is what the script would look like somewhat:

Code:
<form action="" method="POST">
Your Number: <input type="text" name="number">
<submit>
</form>

<?php
function get_all_combos($number) {
	$number = $number;
	some function here to get all possible combinations out of each number.
	echo"$all_combos";
}

$number = $_POST['number'];
get_all_combos($number); // will output all combonations of the numbers.
?>

So basically, you know how big companies sometimes have their numbers like: "1-800-GET-SOME," or "1-800-call-now" etc. Well normal people have like "623-123-4567" but every number has a possible 3 letter combination with it, and that's what I want to display. EVERY possible combination of letters from the inputted number.

If you have ANY ideas, please let me know!

Thanks.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Just assign the letters to a number, then for a for loop while outputting the combinations.

Pseudocode:

PHP:
$one = array("a", "b","c");
$two = array("d", "e", "f");

. . . etc etc. . .

if the number is 123-456-7890

then break the phone number down by numeral and do each for loop accordingly.

This is a pretty easy script to do.

Be warned though, if you want every possible combo, including area code, then the number of combinations will be HUGE.

-Bob
 
0
•••
Can you give me and example of the loop aswell? Thanks!
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back