Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Borate's Blog:
Porter Stemming algorithm for search
Apr 29, 2009 @ 12:57:06

In a recent post to his blog Sameer looks at implementing a Stemming algorithm to search an array of words. It uses this library (as written by Richard Heyes).

A stemming algorithm lets you reduce each English input word to its basic root or stem (e.g. 'walking' to 'walk') so that variations on a word ('walks', 'walked', 'walking') are considered equivalent when searching. This stems can than be used in a search query rather than the original words, which generally (but not always) results in more relevant search results.

His code example uses the library to search for two different types of strings - a single word and a phrase (with stop words removed). The Stem() method is called on the word and the results are looped through to remove all matching the values in the stop words array.

tagged: stop word search stem root query library richardheyes

Link:

PHPMac.com:
IP Banning
Mar 06, 2006 @ 13:18:29

PHPMac.com has posted a quick tutorial on how to "ban an IP" from your site.

Blocking certain IP addresses from your site is actually much easier than you might think.

In fact, it is only a seven-line code inserted at the top of your page!

The code basically just looks in an array of IP values and checks to see if the remote user's matches any of them. If it does, it echos out an error and stops the page execution. Obviously, this is just a basic example, and could be enhanced with a databse table that would be easier to manage than just the static array.

tagged: IP banning remote address check array stop execution IP banning remote address check array stop execution

Link:

PHPMac.com:
IP Banning
Mar 06, 2006 @ 13:18:29

PHPMac.com has posted a quick tutorial on how to "ban an IP" from your site.

Blocking certain IP addresses from your site is actually much easier than you might think.

In fact, it is only a seven-line code inserted at the top of your page!

The code basically just looks in an array of IP values and checks to see if the remote user's matches any of them. If it does, it echos out an error and stops the page execution. Obviously, this is just a basic example, and could be enhanced with a databse table that would be easier to manage than just the static array.

tagged: IP banning remote address check array stop execution IP banning remote address check array stop execution

Link:


Trending Topics: