Skip to content

Instantly share code, notes, and snippets.

@carlitorweb
Last active March 3, 2016 22:20
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 carlitorweb/b7f37334c2f24ca6102e to your computer and use it in GitHub Desktop.
Save carlitorweb/b7f37334c2f24ca6102e to your computer and use it in GitHub Desktop.
[Joomla] Search for the {readmore} tag and split the text up accordingly
$pattern = '#<hr\s+id=("|\')system-readmore("|\')\s*\/*>#i';
$tagPos = preg_match($pattern, $someText);
if ($tagPos == 0)
{
$introText = $someText;
$fullText = '';
}
else
{
list ($introText, $fullText) = preg_split($pattern, $someText, 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment