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;