After having owned the BMW X3, the MDX is a pleasure to drive. Reliability is great for 25,000 miles. Only things wrong are Bluetooth; rings and cannot hear whose on the other end and many viable addresses do not show up on Navigation system. Dealer service excellent. A few miss-steps in design; no lights for A/C controls at night; rear view pic doesn't come on in reverse for 10 seconds, some wind noise, transmission can be rough and erratic. No ipod plug which I didn't realize until after I purchased. Front end design could be improved, very masculine. Sounds like a lot but I do really like this car. Also test drove BMW X5 and Lexus 400.
is there any library or prepared class to get all of words from this sentence cleaney?
i know some function is exist like preg_match…
The solution would be not to match them in the first place. :-) Try this:
preg_match_all('/\w+/', $str, $matches); // match words
$matchesUnique = array_unique($matches[0]); // get new array w/o duplicates
print_r($matchesUnique);
I don’t get regular expressions. To me it would be simpler to use explode() as @Mittineague said, then write a short function to strip out anything that isn’t a letter and pass each one through that.
Oh, do you mean ranking for keywords then? Ok, well if you are trying to rank for all of those keywords, it actually makes no sense. You would need to find which keywords are most useful to rank for. Generic words like “now” are worthless to optimize on and try to rank for.
If, on the other hand, you aren’t talking about keywords and optimizing a site, but instead you are trying to find that sentence in a source, that is a different conversation all together.
Actually, if you have followed labour’s other topics, it is not about keywords or optimization.
The goal is to identify words in long text strings and highlight them according to an arbitrary color scheme based on an arbitrary “dictionary” of sorts.