Table of Contents

Syntax

string metaphone(string $text [, int $phonemes = 0])

(PHP 4 >= 4.01, PHP 5)

$text Source text or binary string for the metaphone analysis.
$phonemes Restrict the length of consequtive phonetic characters to this amount, zero denotes no limit.
RETURNS Phonetic code for the supplied source string $text or false on error.

What it Does

Calculates the metaphone key for the provided string $text. This is similar to the soundex function which uses phonetics to create code for common English character sequences. It is a bit more accurate than soundex because it understands many of the basic rules of English pronunciation.

Example

// calulate the metaphone for Mr. Rasmus
$metaphone = metaphone('Rasmus Lerdorf');
echo 'The metaphone for "Rasmus Lerdorf" is: ' . $metaphone;
 
metaphone.txt · Last modified: 2011/02/14 14:00 by orvado
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki