Welcome Guest, Not a member yet? Register   Sign In
find a string...
#3

[eluser]outtolunch[/eluser]
Ok, i managed to work this out i think.

Maybe my question wasn't the best. So yeah, for example i have some records in the database-> car, red car, green car.

The string is-> "I have got a red car."

I want to check the records against the string and find out what i've got in that string.

So i run the loop, i check "car" against the string then "red car" and then "green car". By the way i'm using strpos();

So the system will find two matches, "car" and "red car". I recorded those results into an array, and displayed the last record of the array, which is "red car".

It does't really sound as the best way of doing it, but it works for me. Of course if you have a table with records laid like that-> "red car", "car" I would pull out car out of the array, which wouldn't be accurate.

Uhh....

Feel free to comment.


Messages In This Thread
find a string... - by El Forum - 05-16-2010, 08:24 AM
find a string... - by El Forum - 05-16-2010, 10:26 AM
find a string... - by El Forum - 05-16-2010, 11:01 AM
find a string... - by El Forum - 05-16-2010, 01:20 PM
find a string... - by El Forum - 05-16-2010, 01:32 PM
find a string... - by El Forum - 05-16-2010, 05:18 PM
find a string... - by El Forum - 05-16-2010, 11:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB