摘要:', ftell($file_handle); //0 fseek($file_handle, 3);//该函数把文件指针从当前位置向前或向后移动到新的位置,新位置从文件头开始以字节数度量。 echo '', ftell($file_handle);//3 echo '', fgets($file_handle, 3);//34
阅读全文
摘要:<?php header('Content-Type: text/html; charset=utf-8'); $file = './php34.txt'; $mode = 'w';//w, a, x // PHP提供了如下一些的打开模式: // R(read)读模式 // W(write)替换写模式,将文件内容清零,自动创建不存在的文件。 // A(app...
阅读全文
摘要:_error; } public function __construct() { $this->_max_size = 1024*1024; $this->_type_map = array( '.png' => array('image/png', 'image/x-png'), '.j...
阅读全文
摘要:'; print_r($list); /** * @param 目录地址 */ function readDirsNested($path) { $nested = array();//存储当前目录下所有的文件 $dir_handle = openDir($path); while(false !== $file=readDir($dir_handle)) { ...
阅读全文
摘要:'; //判断当前是否为目录 if(is_dir($path . '/' . $file)) { //是目录 $func_name = __FUNCTION__; $func_name($path . '/' . $file, 1+$deep); } } cl...
阅读全文
摘要:session_1.php session_2.php
阅读全文
摘要:测apache配置文件语法 使用apache/bin/目录中的httpd.exe命令,可以检测apache的配置文件中的语法问题。 使用形式如下: httpd.exe -t 在遇到apache 启动不成功的时候可以用这种方法定位问题
阅读全文
摘要:变量的基本使用 定义变量(赋值):直接给变量赋值,就是定义; 不支持js中的那种“定义但不赋值”的语法。 换句话说,第一次给一个变量赋值,就算定义变量。 取值:所有需要一个变量值的语句中,就会取得该变量的值,常见包括: 输出:echi $v1; //取得$v1的值,并输出 给其他变量赋值$v2 =
阅读全文
摘要:./Factory.class.php ./match_list_c.php ./MatchModel.class.php ./Model.class.php ./MySQLDB.class.php ./template/.htaccess Deny from All ./template/matc
阅读全文
摘要:spl_autoload_register 可以同时注册多个自动加载函数。 ./kang/H.class.php <?php class H { } ./kang/kang.php <?phpfunction kangAutoload($class_name) { echo 'kangAutoloa
阅读全文
摘要:Public, protected, private 用来描述: 成员,在源代码中的哪些位置可以访问 。 Public:公共的:类内,类外,继承链类内 Protected: 类内,继承链类内。 Private:本类内。 一:Private:本类内。 <?phpclass H { // public
阅读全文