http://www.seo-space.net/blog/41-html-Js-Conditional-Compilation.html 在js的注释中是可以有流程控制,这个也是在今天才发现。虽然这个东西用处不大,但是挺好玩的。 [code] /*@cc_on @if (@_win32) document.write("OS is 32-bit. Browser is IE."); @else document.write("OS is NOT 32-bit. Browser is IE."); @end @*/ [/code] 上面的代码就是注释中的流程控制,用@cc_on来开头就可以了,在里面就可以写i...
by zhanglp888 - Web开发 - 2009-07-02 14:43:37 阅读(4030) 回复(2)
input: TEST_ONE
.Dtu559 { display:none; } 用PHP过滤html里可能被利用来引入外部危险内容的代码。有些时候,需要让用户提交html内容,以便丰富用户发布的信息,当然,有些可能造成显示页面布局混乱的代码也在过滤范围内。 php程序员站 以下是引用片段: #用户发布的html,过滤危险代码 function uh($str) { $farr = array( "/\s+/", //过滤多余的空白 "/]*?)>/isU", //过滤 ]*)on[a-zA-Z]+\s*=([^>]*>)/isU", //...
现用html_TreeMenu来生成树形菜单,看了example难道只能生成列表框样的树形菜单,如何去掉Listbox啊,如何看html_TreeMenu所有的方法?小弟初学pear,请高手不吝赐教,多谢!
在html中,由于中文等字符是通过编码的,因此得到html文件后,怎样解码html中的转义字符比较头痛。有那位高人能提供解码的方式或者代码。 比如“Foxmail著名”对应的是"Foxmail著名" 通过怎样的解码实现把“著名”转换为“著名”呢? 因为是个小程序,所以希望不需要什么库来进行转换。 谢谢先了。
昨天发现php的strip_tags并不好用。他仅仅去除tags,但是javascript和css的内容并不去除。所以找了个正则实现。 ps:这个正则不是我写的。我仅仅是修改了一下。加上了去除css和注释的语句 [code] $search = array ("''si", // 去掉 javascript "''si", // 去掉 css "'<[/!]*?[^<>]*?>'si", // 去掉 html 标记 ...
本帖最后由 mylongwalk 于 2011-05-17 23:15 编辑
如 > => '>' & => '&'等,试了html::Entities; 不知为何 显示为了乱码(或者不显示)。
谢谢。[code]use strict;
use html::Entities;
my $data ="hi>you<and me";
my $content = decode_entities($data);
print $content;[/code]结果:
hi>you
It's easy to convert manpages into PDF or html formats. For PDF, use the -t option with man and then pipe the PostScript output into the ps2pdf program. This command places the manpage for ls into the file ls_man_page.pdf: $ man -t ls | ps2pdf - ls_man_page.pdf The commands to convert a manpage to html are more complex: $ zcat $(man --path ls) | man2html | tail +3 > ls_man_page.html This uses m...