Created
July 9, 2010 17:31
-
-
Save treffynnon/469749 to your computer and use it in GitHub Desktop.
Regex for adding a drop cap span into article text
This file contains 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
<?php | |
$article['full_text'] = preg_replace('/^([\<\sa-z\d\/\>]*)(([a-z\&\;]+)|([\"\'\w]))/', '$1<span class="drop-cap">$2</span>', $article['full_text']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment