StevenHook
asked on
Is there a way to display names and refrences in phonetic alphabet in php?
Hi,
I would like to display reference codes names on our call centre's screens in phonetic alphabet so that they can easily read out the information to the customer.
I was wondering if anyone knows of an easy php plugin that could do this, or even perhaps a font that replaces the letters with their phonetic words?
Thanks
Steven
I would like to display reference codes names on our call centre's screens in phonetic alphabet so that they can easily read out the information to the customer.
I was wondering if anyone knows of an easy php plugin that could do this, or even perhaps a font that replaces the letters with their phonetic words?
Thanks
Steven
Take a look at:
soundex
metaphone
ASKER
Sorry,
Not that kind of phonetic alphabet. I am looking for the NATO phonetic alphabet:
http://en.wikipedia.org/wiki/NATO_phonetic_alphabet
So the stuff it written as: Tango Echo X-ray Tango
So they can read it correctly to the customer on the phone.
Steven
Not that kind of phonetic alphabet. I am looking for the NATO phonetic alphabet:
http://en.wikipedia.org/wiki/NATO_phonetic_alphabet
So the stuff it written as: Tango Echo X-ray Tango
So they can read it correctly to the customer on the phone.
Steven
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
full version excluding numbers
<?php
$a = new to_phon("Phonetic-Alphabet");
echo $a->getPhonetic();
// papa hotel oscar november echo tango india charlie dash alpha lima papa hotel alpha beta echo tango
class to_phon {
private $word = "";
private $alpha = array("a" => "alpha", "b" => "beta", "c" => "charlie","d"=>"delta", "e" => "echo","f"=>"foxtrot","g"=> "golf","h"=>"hotel","i"=> "india","j"=> "juliett","k"=>"kilo","l"=>"lima","m"=>"mike","n"=>"november","o"=>"oscar","p"=>"papa","q"=> "quebec","r"=>"romeo","s"=>"sierra","t"=>"tango","u"=>"uniform","v"=>"victor","w"=>"whiskey","x"=>"x-ray","y"=>"yankee","z"=>"zulu","-"=>"dash");
function __construct($astring) {
$this->word = $astring;
}
private function getSplitstring() {
return str_split(strtolower($this->word));
}
public function getPhonetic() {
foreach ($this->getSplitstring() as $aletter) {
$return.=$this->alpha[$aletter] . " ";
}
return trim($return);
}
}
?>