Skip to content

Instantly share code, notes, and snippets.

@mutoo
Last active December 31, 2015 03:49
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 mutoo/7930215 to your computer and use it in GitHub Desktop.
Save mutoo/7930215 to your computer and use it in GitHub Desktop.
split post at more tag;
if ( preg_match('/<!--more(.*?)?-->/', $post, $matches) ) {
list($main, $extended) = explode($matches[0], $post, 2);
$more_text = $matches[1];
} else {
$main = $post;
$extended = '';
$more_text = '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment