Skip to content

Instantly share code, notes, and snippets.

@lukasfarina
Created May 23, 2016 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukasfarina/afe7ed8721156ee23679f0e321f6c6e0 to your computer and use it in GitHub Desktop.
Save lukasfarina/afe7ed8721156ee23679f0e321f6c6e0 to your computer and use it in GitHub Desktop.
Substring de caractéres não deixando as palavras no meio.
if(preg_match('/^.{1,109}\b/s', $this->content, $match))
return strip_tags($match[0]);
else
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment