background image

 

            

}

        

}

    

}

    

return

 

$stripStr

;

}
 
该自定义函数有效解决了 php_strip_whitespace 系统内置去注释空格函数不能正确理解
<<<EOT(heredoc)的问题
使用方法
代码如下:
 

$str

 = strip_whitespace('<?php'.

$str

);

 
前面一定要拼接这个,我也搞不懂,不拼接的话执行生成的结果是错误的结果
php_strip_whitespace
string php_strip_whitespace (string

$filename

 )

如果仅仅是单文件并且没有 heredoc 的话,还是建议使用快捷的 php_strip_whitespace 函数