Permalink
Browse files

Add replaceTags function

  • Loading branch information...
1 parent bb9ebd4 commit af5d747b074735c8abb7b9d1ebcbb3cdc785cd4f @nganhtuan63 committed Mar 16, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 common/globals.php
View
@@ -481,4 +481,9 @@ function recursive_remove_directory($directory, $empty=FALSE)
function isConsoleApp() {
return get_class(Yii::app())=='CConsoleApplication';
}
+
+
+function replaceTags($startPoint, $endPoint, $newText, $source) {
+ return preg_replace('#('.preg_quote($startPoint).')(.*)('.preg_quote($endPoint).')#si', '$1'.$newText.'$3', $source);
+}
?>

0 comments on commit af5d747

Please sign in to comment.