I've never had time to get into those ereg, eregi etc. functions, and now
I am affraid I probably need to use them. Here is the problem I need to
solve:

I have a string (lead of an article), about 200-250 characters long. And
then I do have a search query - variable $q

Now, what I'd like to do is to check wheter this string contains the
search query or not. Case sensitivity is not important, so if the $q
equals to 'SoMeThInG', the script would find also 'sOmEtHiNg'. If the
string contains the search query, I'd like to display 100 characters of
this string (lead) - the search query should be in the middle of this
substring and within BOLD and /BOLD tags.

If the search query is in the beginning of the string, say at position 10,
then I'd like to display 100 first characters of the string... and if it
is say at position 230 (250 chars together), it should display the string
starting at position 250-100.

I know it shouldn't be difficult to do, but I am kind of stuck and
frustrated.

TIA,
Kristjan

P.S. Pls. CC me as well - I am only in the digest.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to