Created
March 4, 2012 07:15
-
-
Save michaeltwofish/1971109 to your computer and use it in GitHub Desktop.
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
<?php | |
$input = 'some stuff <?= $this->foo ?> blah'; | |
echo $input."\n"; | |
echo preg_replace('/\<\?=\s*\$this->(.+?)\s*;?\s*\?>/msx', '<?php echo $this->$1; ?>', $input)."\n"; | |
// Should output: | |
some stuff <?= $this->foo ?> blah | |
some stuff <?php echo $this->foo; ?> blah | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment