随笔分类 -  PHP

摘要:1 %s: %s in %s on line %d\n",39 $error_type, $error_message, $file, $line);40 41 if ($EXIT){42 //跳转到错误窗口43 //echo ''44 }45 }46 47 //3. 写错误日志48 /* 使用指定文件记录错误报告日志,应作如下配置49 * error_reporting = E_ALL50 * ... 阅读全文
posted @ 2013-08-22 16:32 Burn_E 阅读(323) 评论(0) 推荐(0)
摘要:index.php 1 2 3 4 5 9 10 11 图书表管理12 13 添加图书14 图书列表15 搜索图书16 17 exec($sql);25 echo $stmt ? "添加图书成功" : "添加图书失败";26 } elseif ($_GET['action'] == 'update') {27 $sql = "UPDATE... 阅读全文
posted @ 2013-08-22 16:29 Burn_E 阅读(2387) 评论(1) 推荐(0)
摘要:1 '; 26 echo mysql_get_client_info().""; 27 echo mysql_get_host_info().""; 28 echo mysql_get_proto_info().""; 29 echo mysql_get_server_info().""; 30 echo mysql_client_encoding().""; 31 echo mysql_stat().""; 32 } 33 mysql_query('set 阅读全文
posted @ 2013-08-21 10:58 Burn_E 阅读(629) 评论(0) 推荐(2)
摘要:1 "; 19 echo microtime(true).""; 20 echo time().""; 21 echo mktime(0,0,0,1,1,1970).""; 22 echo ""; 23 24 print_r(getdate()); echo ""; 25 print_r(getdate(mktime(10,31,50))); 26 echo ""; 27 28 echo date("Y-m-d H:i:s", time()).& 阅读全文
posted @ 2013-08-16 13:26 Burn_E 阅读(273) 评论(0) 推荐(0)
摘要:1 "; 12 echo "filetype:".filetype($filename).""; 13 echo "filesize:".filesize($filename).""; 14 echo "readable:";var_dump(is_readable($filename)); echo ""; 15 echo "writeable:";var_dump(is_writeable($filename)); echo "&q 阅读全文
posted @ 2013-08-16 13:22 Burn_E 阅读(391) 评论(0) 推荐(0)
摘要:1 "gif", 2=>"jpeg", 3=>"png"); 14 //组合创建图像函数名 15 $createfrom = "imagecreatefrom".$types{$type}; 16 $image = $createfrom($filename); 17 //对该图片进行操作 18 $image = $func($image, $width, $height, $type, $vars); 19 //组合输出图像函数名 20 $output = "image".$t.. 阅读全文
posted @ 2013-08-16 13:10 Burn_E 阅读(449) 评论(0) 推荐(0)
摘要:vcode.class.php 1 width = $width;13 $this->height = $height;14 $this->codeNum = $codeNum;15 $number = floor($height * $width / 15);16 //计算干扰元素数量17 if ($number > 240 - $codeNum) 18 $this->disturbColorNum = 240 - $codeNum;19 ... 阅读全文
posted @ 2013-08-16 12:44 Burn_E 阅读(440) 评论(0) 推荐(0)
摘要:1 绘制图像->输出图像->释放资源 5 */ 6 /* 创建图像 7 * imagecreate(int sx, int sy) 基于调色板的图像(256色) 8 * imagecreatetruecolor(int sx, int sy) 基于真彩色图像,不能用于gif图像 9 */ 10 $image = imagecreatetruecolor(800, 800); 11 /* 设置颜色 12 * imagecolo... 阅读全文
posted @ 2013-08-16 12:35 Burn_E 阅读(681) 评论(0) 推荐(0)
摘要:1 "; 5 6 //2. 常用字符串输出函数 7 /* echo 效率较高,输出多个字符串用逗号隔开 8 * print 效率较低,错误时会返回0 9 * die 输出后退出,如果是字符串,退出前输出,如果是0~254的整数,作为退出状态码 10 * printf 格式化输出 11 * sprintf 格式输出到字符串,返回字符串 12 */ 13 echo "I", " am", " echo", "... 阅读全文
posted @ 2013-07-31 22:58 Burn_E 阅读(504) 评论(0) 推荐(0)
摘要:index.php 用于显示页面 1 2 3 4 图形计算器 5 6 7 8 图形(周长&面积)计算器 9 矩形10 圆形11 12 28 29 30 31 form.class.php 根据action不同(rect,circle)显示不同的form 1 action = $action; 8 //默认rect; 9 $this->shape = ... 阅读全文
posted @ 2013-07-30 23:14 Burn_E 阅读(560) 评论(1) 推荐(0)
摘要:1 name." eat now"; //使用this来引用类的成员属性 10 } 11 private function run(){ //带有权限修饰的成员方法 12 echo "run now"; 13 } 14 15 function __construct($name, $age = 23) { //构造方法,只能有一个,但可以通过默认参数实现类似于C++中的构造函数重载 16 $this->name ... 阅读全文
posted @ 2013-07-30 18:10 Burn_E 阅读(176) 评论(0) 推荐(0)
摘要:1 "; 14 var_dump($array_cont1); 15 echo ""; 16 17 //也可以使用string以及混合下标来声明数组 18 $array_cont2[0] = "aa"; 19 $array_cont2["ID"] = "bb"; 20 $array_cont2["NAME"] = "cc"; 21 print_r($array_cont2); 22 echo ""; 23 24 //使用array格式来声明数组 阅读全文
posted @ 2013-07-29 23:38 Burn_E 阅读(352) 评论(0) 推荐(0)
摘要:1 2 3 "; 16 echo "{$tablename}"; 17 for ($i = 1; $i "; 19 for ($j = 1; $j ".($i*$cols-$cols+$j).""; 21 } 22 echo ""; 23 } 24 25 echo ""; 26 } 27 ... 阅读全文
posted @ 2013-07-22 18:14 Burn_E 阅读(230) 评论(0) 推荐(0)
摘要:1 2 3 4 PHP简易计算器 5 6 7 ";11 else if (!is_numeric($_POST["num1"])) $mess .= "第一个数必须是数字";12 13 if ($_POST["num2"] == "") $mess .= "第二个数不能为空";14 else if (!is_numeric($_POST["num2"])) $mess .= "第二个数必须是数字";15 ... 阅读全文
posted @ 2013-07-21 17:21 Burn_E 阅读(280) 评论(0) 推荐(0)
摘要:1 2 3 "; 12 13 // 2.var_dump函数用来查看表达式的类型和值 14 var_dump($a); 15 var_dump($b); 16 var_dump($c); 17 echo ""; 18 19 // 3. 用empty()函数检测一个变量是否为空,isset()检测一个变量是否设置,unset()释放一个变量 20 $var = ''; 21 var_dump(empty($var)... 阅读全文
posted @ 2013-07-21 17:17 Burn_E 阅读(245) 评论(0) 推荐(0)