01 2012 档案
JS相关
摘要:/** * wrap javascript codes with a html-tag * @author Wilson Zeng */function js($script){ return '<script type="text/javascript">'."\n".$script."\n".'</script>'."\n";}/** * wrap javascript codes with a html-tag & history back * 阅读全文
posted @ 2012-01-17 13:57 重生 阅读(168) 评论(0) 推荐(0)
数组操作
摘要:/** * Like end(),return the first element of an array * @author Wilson Zeng */function first($stack){ if(is_array($stack)){ reset($stack); return current($stack); }else{ return $stack; }} 阅读全文
posted @ 2012-01-17 13:31 重生 阅读(115) 评论(0) 推荐(0)
exforce_download() -- 对CI中force_download()增强后的函数(不依赖CI)
摘要:/** * Enhanced force_download, can accept file in server * @author Wilson Zeng * @param $filename | The name that will use as the download file's nam... 阅读全文
posted @ 2012-01-17 13:30 重生 阅读(1225) 评论(0) 推荐(0)
关于远程操作的函数
摘要:/** * Enhanced file_get_contents, use curl to fetch remote file * @param $file * @author Wilson Zeng */function ex_file_get_contents($file){ //if is ... 阅读全文
posted @ 2012-01-17 13:28 重生 阅读(295) 评论(0) 推荐(0)
exTrim() -- Enhanced trim() to support array
摘要:/** * Enhanced trim() to support array * @author Wilson Zeng */function exTrim($mixed, $removeEmptyString = FALSE){ if(is_array($mixed)){ foreach($mixed as $index => &$item){ $item = exTrim($item); if($removeEmptyString && $item === ''){ array_splice($mixed, $index, 1); ... 阅读全文
posted @ 2012-01-17 12:05 重生 阅读(219) 评论(0) 推荐(0)