PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I calculate the metaphone of a string?


If you want to do this then you will need to use the metaphone function within PHP.

If you don't know what this is or why you might want to know, then the chances are that you don't!

Basically this is useful when you are looking for words that are similar sounding, and so has applications in things like spell checkers and so on.

<?php
$text 
"stitch";
$text2 "rich";

$meta1 =  metaphone($text);

$meta2 =  metaphone($text2);

echo 
"Metaphone returns: $meta1 and $meta2";
//Metaphone returns: STTX and RX
?>


Similar sounding words will have the same key, e.g. 'sun' and 'son'.



Comment on this Question and Answer >>>

ASK A QUESTION

More strings PHP Questions

How do I remove trailing whitespace?

How do I find the length of a string in PHP?

How do I turn a string into an array?

How do I replace a word in a string in PHP?

How can I remove spaces from around a string value?



Custom Search