Example Output:

Listed below are 6 different spelling for the name Clinton found in collection of news articles in addition to original English spelling.
Function Input Output
PHP soundex function Clinton C453
ArSoundex Method كلينتون K453
ArSoundex Method كلينتن K453
ArSoundex Method كلينطون K453
ArSoundex Method كلنتن K453
ArSoundex Method كلنتون K453
ArSoundex Method كلاينتون K453
ArSoundex Method كلينزمان K452
 
Listed below are 6 different spelling for the name Milosevic found in collection of news articles in addition to original English spelling.
Function Input Output
PHP soundex function Milosevic M421
ArSoundex Method ميلوسيفيتش M421
ArSoundex Method ميلوسفيتش M421
ArSoundex Method ميلوزفيتش M421
ArSoundex Method ميلوزيفيتش M421
ArSoundex Method ميلسيفيتش M421
ArSoundex Method ميلوسيفتش M421
ArSoundex Method ميلينيوم M455

Example Code:

<?php
    
require '../../Arabic.php';
    
$Arabic = new I18N_Arabic('Soundex');
    
    
$Clinton = array('كلينتون''كلينتن''كلينطون''كلنتن''كلنتون''كلاينتون');

    echo <<<END
<table border="0" cellpadding="5" cellspacing="2" align="center">
<tr>
    <td colspan="3">Listed below are 6 different spelling for the name
    <i><a href="http://en.wikipedia.org/wiki/Bill_Clinton" target=_blank>Clinton</a></i>
      found in collection of news articles in addition to original English spelling.</td>
</tr>
<tr>
    <td bgcolor=#000000 width=33%><b><font color=#ffffff>Function</font></b></td>
    <td bgcolor=#000000 width=33%><b><font color=#ffffff>Input</font></b></td>
    <td bgcolor=#000000 width=33%><b><font color=#ffffff>Output</font></b></td>
</tr>
END;
echo 
'<tr>
        <td bgcolor=#f5f5f5>PHP soundex function</td>
        <td bgcolor=#f5f5f5>Clinton</td>
        <td bgcolor=#f5f5f5>' 
soundex('Clinton') . '</td>
      </tr>'
;

foreach (
$Clinton as $name) {
    echo 
'<tr>
            <td bgcolor=#f5f5f5>ArSoundex Method</td>
            <td bgcolor=#f5f5f5>' 
$name '</td>
            <td bgcolor=#f5f5f5>' 
$Arabic->soundex($name) . '</td>
          </tr>'
;
}

echo 
'<tr>
        <td bgcolor=#f5f5c5>ArSoundex Method</td>
        <td bgcolor=#f5f5c5>كلينزمان</td>
        <td bgcolor=#f5f5c5>' 
$Arabic->soundex('كلينزمان') . '</td>
      </tr>'
;

echo <<<END
<tr>
    <td colspan=3>&nbsp;</td>
</tr>
<tr>
    <td colspan=3>Listed below are 6 different spelling for the name
    <i><a href="http://en.wikipedia.org/wiki/Milosevic" target=_blank>Milosevic</a></i>
     found in collection of news articles in addition to original English spelling.</td>
</tr>
<tr>
    <td bgcolor=#000000><b><font color=#ffffff>Function</font></b></td>
    <td bgcolor=#000000><b><font color=#ffffff>Input</font></b></td>
    <td bgcolor=#000000><b><font color=#ffffff>Output</font></b></td>
</tr>
<tr>
END;
    
    
$Milosevic = array('ميلوسيفيتش''ميلوسفيتش''ميلوزفيتش''ميلوزيفيتش''ميلسيفيتش''ميلوسيفتش');

    echo 
'<tr>
            <td bgcolor=#f5f5f5>PHP soundex function</td>
            <td bgcolor=#f5f5f5>Milosevic</td>
            <td bgcolor=#f5f5f5>' 
soundex('Milosevic') . '</td>
          </tr>'
;
                       
    foreach (
$Milosevic as $name) {
        echo 
'<tr>
                <td bgcolor=#f5f5f5>ArSoundex Method</td>
                <td bgcolor=#f5f5f5>' 
$name '</td>
                <td bgcolor=#f5f5f5>' 
$Arabic->soundex($name) . '</td>
              </tr>'
;
    }

    echo 
'<tr>
            <td bgcolor=#f5f5c5>ArSoundex Method</td>
            <td bgcolor=#f5f5c5>ميلينيوم</td>
            <td bgcolor=#f5f5c5>' 
$Arabic->soundex('ميلينيوم') . '</td>
          </tr></table>'
;

Total execution time is 0.0045228004455566 seconds
Amount of memory allocated to this script is 477584 bytes

Names of included or required files:

Related Class Documentation