How could I say with regular expression: from first space (blank) untill last space
example🙁text is dynamic)
read from "do" to "do" "how do you do today ?"
thanks
You could explode the string: http://www.php.net/manual/en/function.explode.php
then use the created array, counting the elements then not printing the first and last elements.
don't think thats help. this is for search engine on the web site.
I have long text and searched text. I need to shrink text to eg. 50 chars before and 50 chars after searched text. I did it, but now I have problem with broken words, like:
it's nice day
become
's nice da
I was thinking if it's possible to solve this problem with regex.
got any suggestion?
Tnx
//removing first part $buffer=eregi_replace('[a-zA-z0-9.,!?:;]*[[:space:]]','',$buffer);
//removing last part $buffer=eregi_replace('[[:space:]][a-zA-z0-9.,!?:;]*$','',$buffer);