Last active
March 3, 2016 22:20
-
-
Save carlitorweb/b7f37334c2f24ca6102e to your computer and use it in GitHub Desktop.
[Joomla] Search for the {readmore} tag and split the text up accordingly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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