For example, it just returns the snippet around which the searching keyword exists.
And part of the text is replaced by "...".
Is it possible to achieve that goal with PHP and MySQL?
For example, it just returns the snippet around which the searching keyword exists.
And part of the text is replaced by "...".
Is it possible to achieve that goal with PHP and MySQL?
This is probably what you want (EDIT):
Shamelessly stolen from the Cake TextHelper.
My solution for multiple multiple keywords and multiple occurences (also works for accents case insensitive):
This is example result for query = "švihov prohlídkám"
Modified deceze's function slightly to allow multiple phrases. e.g. your phrase can be "testa testb" and if it does not find testa, then it will go to testb.
Highlight function