[Solved] From numeric Phone # to alphatized... How???
Posted: Wed Mar 21, 2007 9:16 pm
Alright, I won't post something asking for help if I didn't try to attack the problem myself. Below you will see my (poor) excuse for attempting to transform a phone number (123-5405) into many strings that can be dialed into a phone. Basically, want I wanted was a list containg numerous (most likely 3k) possible stings that can be dialed into a phone that will call the same number.
Any ideas how to tackle this beast?
Any ideas how to tackle this beast?
Code: Select all
<?php
/* Don't laugh but here is my thinking w/o coffee at 10PM at night. */
$numberArray = array(
0 => array('0'),
1 => array('1'),
2 => array('a','b','c'),
3 => array('d','e','f'),
4 => array('g','h','i'),
5 => array('j','k','l'),
6 => array('m','n','o'),
7 => array('p','q','r','s'),
8 => array('t','u','v'),
9 => array('w','x','y','z')
);
$number = array(1,2,3,5,4,0,5);
//Go through whole number
for($i=0,$k=count($number);$i<$k;$i++)
{
//Pull out letters
for($i=0,$k=count($number[$i]);$i<$k;$i++)
{
/* P.S. - Yes I know I use $i and $k again.... i was only thinking not actually running this code. */
$combo = $numberArray[(int)$number[$i]]
}
}