Hi all, how would I go about searching a string for key words?
For example. User enters "What is your name?" The script scans the string for the words what and name and returns the result 'Steve'.
Cheers, Steve
$query = "Steve"; $string = "This is Steve's Computer."; if(eregi($query,$string)){ //ereg for case-sensative, eregi for case-insensative echo "$query was found in $string." } else{ echo "Could not find $query in $string." }
hope that helps.