摘要: /** * 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 重生 阅读(158) 评论(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 重生 阅读(105) 评论(0) 推荐(0) 编辑
摘要: /** * 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 重生 阅读(1206) 评论(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 重生 阅读(281) 评论(0) 推荐(0) 编辑
摘要: /** * 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 重生 阅读(203) 评论(0) 推荐(0) 编辑