您的位置: 首页 > 发表在 2014年08月 的所有文章
8月232014
8月232014
php递归删除指定目录下的非空目录及文件
<?php
header('content-type:text/html;charset=utf-8');
function deldir($dirpath){
if(!file_exists($dirpath)){
exit('Nothing is about that!');
}
...阅读全文
评论:0条
8月232014
js全选checkbox
js全选checkbox
<input type="checkbox" name="selectall" value=on onclick="selectAll()">
<script>
function selectAll(form) {
var obj = document.getElement...阅读全文
评论:0条
8月232014
php十六进制转换RGB函数
/**
* 十六进制转RGB
* @param string
* @return array
*/
function hex2rgb($hexColor) {
$color = str_replace('#', '', $hexColor);
if (strlen($color) > 3) {
$rg...阅读全文
评论:0条
8月232014
php根据key获取子目录
function getHashDir($key, $level = 2) {
$hash_dir = array();
$hash_arr = str_split(sha1($key), 2);
for($i = 0; $i < $level; $i++) {
$hash_dir[] = $hash_arr[$i...阅读全文
评论:0条
8月232014
php过滤xss代码
根据白名单对字符串进行过滤。如果字符串包含白名单意外的html标签,或者白名单允许的标签但属性不在白名单内,则这些部分会被过滤掉。
<?php
/**
* Prevent XSS.
*
* @author liuxd
*/
class XssFilter
{
/**
* 设...阅读全文
评论:0条