Created
February 12, 2015 02:28
-
-
Save mulatinho/532f5f4d71a90ae6211f to your computer and use it in GitHub Desktop.
hmm.. some regexp that i wrote late night
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
$buffer = preg_replace('/(http([^\s]+))/', '<a target="_blank" href="\\1">\\1</a>', $buffer); | |
$buffer = preg_replace('/(image:)([^\s]+)/', | |
'<img style="float: right; margin: 0px 0px 15px 15px; width: 150px;" src="\\2"/>', $buffer); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment