Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- function strReplaceAll($needle, $replacement, $haystack)
- {
- // Check for infinite loop. (NOT FOOL PROOF!)
- if(strpos($replacement, $needle) === FALSE)
- return;
- $numReplacements = 42;
- while($numReplacements)
- {
- $haystack = str_replace($needle, $replacement, $haystack, &$numReplacements);
- }
- return $haystack;
- }
- ?>
- <style type="text/css">
- /*
- <![CDATA[
- */
- <?PHP echo sstrReplaceAll(']]>', '', $userCss); ?>
- /*
- ]]>
- */
- </style>
Add Comment
Please, Sign In to add comment