question regarding content search in array with PHP
ik <[email protected]> Tue, 18 Dec 2007 19:06:55 +0200
| Newsgroups | gmane.culture.hackers.israel |
|---|---|
| Message-ID | <[email protected]> |
Hello list, I have an array that for the example will look as follows: linux, windows, mac os, beos, os/2, freebsd, netbsd, irix .... And a string: "linux kernel 2.6.24" Now I wish to find the closest value of the string in the array -> "linux". But the problem as you can see, is that the string contain more content then the array value. I can think on many unefficient ways to find the part of string as an array value, but I'm looking for an efficient way to do it. specially if I need to serve a lot of strings on after the other... The problem is, that I must use PHP (because I can think on an answer using Perl, that I haven't tested). Any ideas how I can do it in an efficient way ? Thanks, Ido -- http://ik.homelinux.org/