[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 02-02-2006, 09:31 AM   #1 (permalink)
NamePros Regular
 
Join Date: Aug 2005
Location: arizona
Posts: 565
27.75 NP$ (Donate)

p0iz is just really nicep0iz is just really nicep0iz is just really nicep0iz is just really nicep0iz is just really nice


Phone Number Combination Script!

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.
p0iz is offline  
Old 02-02-2006, 10:10 AM   #2 (permalink)
NamePros Regular
 
moondog's Avatar
 
Join Date: Jun 2004
Posts: 476
3,677.00 NP$ (Donate)

moondog is a glorious beacon of lightmoondog is a glorious beacon of lightmoondog is a glorious beacon of lightmoondog is a glorious beacon of lightmoondog is a glorious beacon of lightmoondog is a glorious beacon of light


Just assign the letters to a number, then for a for loop while outputting the combinations.

Pseudocode:

PHP Code:
$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
__________________
The mass purge has begun.
moondog is offline  
Old 02-02-2006, 12:03 PM   #3 (permalink)
NamePros Regular
 
Join Date: Aug 2005
Location: arizona
Posts: 565
27.75 NP$ (Donate)

p0iz is just really nicep0iz is just really nicep0iz is just really nicep0iz is just really nicep0iz is just really nice


Can you give me and example of the loop aswell? Thanks!
p0iz is offline  
Closed Thread


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

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

BB 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
Huge Script Pack for $5 with Resale Rights dsforsaken Scripts For Sale 32 12-03-2005 08:46 PM
Phone Number Domains dnslife Domain Name Discussion 3 12-14-2003 08:38 AM
Domain Rating Script for Sale : $200.00 - only 10 scripts will be sold fonzerelli_79 Scripts For Sale 3 08-31-2003 08:41 AM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 12:49 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85