//循环显示文件,返回array public static function dirAllFile($dirName) { // global $array; $array = array(); // util::pre_print_r($array); if ($handle = opendir("$...
//循环删除目录和文件函数 public static function delDirAndFile($dirName, $delDir = 0) { if ($handle = opendir("$dirName")) { while (false !== ( $item = readdir($h...
/**$sourcestr 是要处理的字符串$cutlength 为截取的长度(即字数) */static function cut_str($sourcestr, $cutlength, $type = true){$returnstr = ''; $i = 0; $n = 0; $str_length = strlen(trim($sourcestr)); //字符串的字节数 w...
/**下载到本地 */ static function httpcopy($url, $file = "", $timeout = 600) { if (empty($file)) return false; $dir = pathinfo($file, PATHINFO_DIRNA...
/** * 判断是否为utf8字符串 * @parem $str * @return bool 180it.com */ function is_utf8($str) { if ($str === mb_convert_encoding(mb_convert_encoding($str, "UTF-32&quo...
/**检查路径是否存在@parem $path@return bool */function path_exists($path){$pathinfo = pathinfo($path . '/tmp.txt'); if (!empty($pathinfo ['dirname'])) { if (file_exists($pathinfo ['dirname']) === false...
/** * 写文件 */ function put_file($file, $content, $flag = 0) { $pathinfo = pathinfo($file); if (!empty($pathinfo ['dirname'])) { if (file_exists...
/**获得用户的真实IP 地址 *@param 多个用多行分开@return void */public static function get_client_ip(){static $realip = NULL; if (self::$client_ip !== NULL) { return self::$client_ip; } if (isset($_SERVER['HTTP_...
/** * 获取远程数据 * @param $url 地址 * @param $post_data 参数 * @param $method 方法 * @param $timeout 延时 */ function send($url = "", $post_data = '', $method = 'POST', $timeout = 20) { ...
/** * url 跳转 * @param $url 跳转的url * @param $type 跳转类型 301 404 * @param $tip 提示信息 */ function redirect($url = '/', $type = '', $tip = '') { if ($type == '301') { Header('HT...