Greets,
What If I want to return a certain number of words from the beginning or end of a text field?
I can't see a 'left words' or 'right words' function for string replace.
is this labled as something else?
See the preg_match function: preg_match("/((\S+\s){1,19}\S+)/",$textfield,$matches); echo $matches[1];
to get the left 20 you can use substr(),
read here:
http://www.php.net/manual/en/function.substr.php
and for the right 20 you can user a combination of strlen() and substr()
read here for strlen():
http://www.php.net/manual/en/function.strlen.php
hope this helps, good luck!!