Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- # Purpose: to strip unwanted whitespace from $body so as to reduce bandwidth.
- # Santax: ramcms_remove_body_whitespace ( str $body )
- # Where:
- # $body is the contents of our webpage
- #
- function ramcms_remove_body_whitespace(&$body)
- {
- # if <PRE> or <pre> or <textarea> or <TEXTAREA> is found in $body then preserve whitespace.
- # otherwise remove all tabs and newlines.
- if(strstr($body,'<PRE')==false && strstr($body,'<pre')==false && strstr($body,'<TEXTAREA')==false && strstr($body,'<textarea')==false)
- {
- # strip all newlines and tabs.
- $body=str_replace("\t",'',str_replace("\n",'',str_replace("\r",'',$body)));
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement