位置: 编程技术 - 正文
推荐整理分享PHP:php_strip_whitespace()的用法_misc函数,希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!
(PHP 5)
php_strip_whitespace — 返回删除注释和空格后的PHP源码
说明 string php_strip_whitespace ( string $filename )返回删除注释和空格后 filename 的PHP源码。这对实际代码数量和注释数量的对比很有用。 此函数与 命令行 下执行 php -w 相似。 commandline.
参数filename
PHP文件的路径。
返回值在成功时返回过滤后的代码,或者在失败时返回空字符串。
Note:
此函数在PHP 5.0.1后以所述方式工作。之前它仅会返回一个空字符串。关于更多此BUG的信息与其行为,详见BUG报告 »#。
范例
Example #1 php_strip_whitespace() 的例子
<?php//PHPcommenthere/**AnotherPHPcomment*/echophp_strip_whitespace(__FILE__);//Newlinesareconsideredwhitespace,andareremovedtoo:do_nothing();?>以上例程会输出:
可以注意到PHP的注释已不存在,成为第一个echo语句前的换行和空格。
PHP:php_check_syntax()的用法_misc函数 php_check_syntax(PHP5=5.0.4)php_check_syntax检查PHP的语法(并执行)指定的文件说明boolphp_check_syntax(string$filename[,string&$error_message])对指定的filename进行语法检查,
PHP:pack()的用法_misc函数 pack(PHP4,PHP5)packPackdataintobinarystring说明stringpack(string$format[,mixed$args[,mixed$...]])Packgivenargumentsintoabinarystringaccordingtoformat.TheideaforthisfunctionwastakenfromPerlandallform
PHP:highlight_file()的用法_misc函数 highlight_file(PHP4,PHP5)highlight_file语法高亮一个文件说明mixedhighlight_file(string$filename[,bool$return=false])使用PHP内置的语法高亮器所定义的颜色,打印输出或者返
标签: PHP:php_strip_whitespace()的用法_misc函数
本文链接地址:https://www.jiuchutong.com/biancheng/280630.html 转载请保留说明!友情链接: 武汉网站建设