首页 技术教程 实用代码 注册破解 正则表达式 网址导航 电子书籍

用xslt对xml进行缩进格式化处理

下面就是简单的例子,这里提供2中方法:test.htm<SCRIPT>//装载数据x = "<r><a name='net_lover'>aaaaaaaaaaa</a> <b>bbbbbbb</b><a>aaaaaaaaaaa</a><b>bbbbbbb</b></r>"var source = new ActiveXObject("Msxml2.DOMDocument");source.async = false;source.loadXML(x)alert(source.xml)// 装载样式单var stylesheet = new ActiveXObject("Msxml2.DOMDocument");stylesheet.async = false;stylesheet.resolveExternals = false;stylesheet.load("style.xsl");alert(stylesheet.xml)// 创建结果对象var re...
类别:网页编程 - XML应用    查看:139    更新:2014-06-23

PHP的日期时间格式化函数

函数名:date_format参数: $string 时间源,可以是2006-04-24 09:56:07这种格式,$format要格式化的形式,如%Y年%m月%d日%H时%M分%S秒看需要删改示例:<?phpecho date_format($rs['time'],'%Y年%m月%d日%H时%M分%S秒');?> 以下是PHP代码:【复制】 function date_format($string, $format="%b %e, %Y", $default_date=null){if (substr(PHP_OS,0,3) == 'WIN') {$_win_from = array ('%e', '%T', '%D');$_win_to = array ('%#d', '%H:%M:%S', '%m/%d/%y');$format = str_replace($_win_from, $_win_to, $format);}if($string != '') {return strftime($format, smarty_make_timestamp($string));} else...
类别:网页编程 - PHP技术    查看:125    更新:2014-05-05

PHP的日期时间格式化函数

函数名:date_format参数: $string 时间源,可以是2006-04-24 09:56:07这种格式,$format要格式化的形式,如%Y年%m月%d日%H时%M分%S秒看需要删改示例:<?phpecho date_format($rs['time'],'%Y年%m月%d日%H时%M分%S秒');?> 以下是PHP代码:【复制代码】 function date_format($string, $format="%b %e, %Y", $default_date=null){if (substr(PHP_OS,0,3) == 'WIN') {$_win_from = array ('%e', '%T', '%D');$_win_to = array ('%#d', '%H:%M:%S', '%m/%d/%y');$format = str_replace($_win_from, $_win_to, $format);}if($string != '') {return strftime($format, smarty_make_timestamp($string));} ...
类别:网页编程 - PHP技术    查看:121    更新:2014-04-18