English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP metaphone() Function Usage and Example

PHP String Function Manual

The metaphone() function is used to calculate the metaphone key of a string.

Syntax

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

Definition and Usage

Used to calculate the metaphone key of a string

Return Value

Returns the metaphone key as a string, or FALSE on failure.

Parameter

Serial NumberParameters and Description
1

str

Input String

2

length

Specify the maximum length of the metaphone key.

Online Example

Try the following example, calculate "w3Calculate the metaphone key for "w

<?php
   //Calculate "oldtoolbag.com"'s metaphone key and output
   echo metaphone("oldtoolbag.com");
?>
Test and see‹/›

Output Result

NHKM

PHP String Function Manual