string comparison in php

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

i am writing a small application where a user enters a phrase in the
textfield and i would like to display all the files present in the
root directory which consists of the keyword or keywords entered by
the user.

i have used a few comparison functions but i am not getting the
expected result.

$my_file = file_get_contents("filename.html");
what ever the user enters whether it is a single word or few words i
would like to compare with $my_file in a case insensitive manner.

can anyone suggest the best method and how to go about.


Re: string comparison in php

Quoted text here. Click to load it

i think the Reg_Expression works for u.


Re: string comparison in php

Quoted text here. Click to load it

Look for the "User Contributed Notes" at the end.

do search for "auto suggest" in search..

Re: string comparison in php

Sudhakar wrote:
Quoted text here. Click to load it

This can get complicated quickly.  If they enter one word, you can
easily search each file for that word.  If they enter two words, what if
those words appear, but not together?

Either way, you will need to open each file, read it into memory and
search it.  You can do it in your PHP program, but you might find it
faster to execute grep and let the system do it.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline