Main Content
Finding variations on a surname Archive - Originally posted on "The Horse's Mouth" - 2009-02-17 23:51:40 - Graham Ellis
Here's a little demonstration of how you can use PHP to look for a 'similar word' - in this case, from a file of surnames. Have I done all the hard work? No - I crawled for some surnames to add to my demonstration file, and I used PHP's built in functions to do the hard work!
Run Demonstration or see program code . Try it with London , Ellis , Johnstone , Smith and Briscoe . Learn how to do it on a PHP Techniques Workshop
Some other articles
H110 - HTML Web Page Data Handling Filtering PHP form inputs - three ways, but which should you use? Sending out an email containing HTML from within a PHP page What features does this visitors browser support? (PHP) How to tweet automatically from a blog This article Injection Attack if register_globals in on - PHP Text formating for HTML, with PHP Emailing as HTML (Web Page) - PHP example Buffering output - why it is done and issues raised in Tcl, Perl, Python and PHP Sorting people by name in PHP .pdf files - upload via PHP, store in MySQL, retrieve PHP - good coding practise and sticky radio buttons Hot answers in PHP Robust PHP user inputs Current cost in your local currency H107 - String Handling in PHP Splitting the difference with PHP Setting up strings in PHP Solution looking for a problem? Lookahead and Lookbehind More than just matching with a regular expression in PHP Getting more than a yes / no answer from a regular expression pattern match Learning to program in PHP - Regular Expression and Associative Array examples Regular Expression modifiers in PHP - summary table PHP - moving from ereg to preg for regular expressions Divide 10000 by 17. Do you get 588.235294117647, 588.24 or 588? - Ruby and PHP Handling (expanding) tabs in PHP Curly braces within double quoted strings in PHP Handling nasty characters - Perl, PHP, Python, Tcl, Lua Making Regular Expressions easy to read and maintain This article Regular Expressions in PHP Regular expression for 6 digits OR 25 digits Do not SHOUT and do not whisper Short and sweet and sticky - PHP form input A taster PHP expression ... Ignore case in Regular Expression Regular Express Primer PHP Regular expression to extrtact link and text Date conversion - PHP Looking ahead and behind in a Regular Expression Evaluating arithmetic expressions in configuration files How similar are two words Don't expose your regular expressions Robust PHP user inputs PHP - dividing a string up into pieces The fencepost problem Converting between acres and hectares Running a Perl script within a PHP page Splitting the difference PHP Magic Quotes the array returned by preg_match_all PHP and natural sorting Here documents G996 - Newsletter Scripts Oops - I typed ci not vi, and have lost my file ... Changing Images Controlling, supressing, enabling PHP error messages Error Handling in Lua with assert and pcall Grouping rows for a summary report - MySQL and PHP Using the internet to remotely check for power failure at home (PHP) This article mod_rewrite for newcomers Ajax - going Asyncronous and what it means First class functions in Lua lead to powerful OO facilities Factory method example - Perl Replacing the last comma with an and Script to present commonly used images - PHP Efficient PHP applications - framework and example Error logging to file not browser in PHP Resetting session based tests in PHP What are factory and singleton classes? mysqldump and mysqlrestore Final, Finally and Finalize - three special words in Java .pdf files - upload via PHP, store in MySQL, retrieve