
PHP
文章平均质量分 63
garcon1986
永远走在路上的前行者
关注实现细节,向专家进发!!!
展开
-
Port 80 or 443 (SSL) already in use ! Installing Apache2.2 service failed!的解决方案
/***************************by Jiangong SUN********************************/ 问题:安装XAMPP 1.70过程中,报错 : Port 80 or 443 (SSL) already in use ! Installing Apache2.2 service failed! 在XAMPP Contro原创 2010-02-12 23:03:00 · 6073 阅读 · 0 评论 -
面试总结之Datavance
/*********by Jiangong SUN*******/ 1. PHP命令的信息手册2. 获得来自表格的数据的方法$_GET[''],$_POST['']3. 定义php脚本里的cookiesetcookie()4. 定义php脚本的头文件header()5. 头文件里重定向页面的方法header("Location:htt原创 2010-09-11 11:23:00 · 722 阅读 · 0 评论 -
ADODB数据库抽象层操作
/****************by Jiangong SUN************///include fileinclude("adodb5/adodb.inc.php");include("adodb5/adodb-pager.inc.php");//set variables$server = 'localhost';$user = 'charles原创 2010-10-11 22:17:00 · 805 阅读 · 0 评论 -
PHP5 版本进化总结
/***************by Jiangong SUN****************/ PHP 5.0.0 Beta 1 - 2003-06-29 使用Zend Engine 2SQLite扩展捆绑到PHP并默认启动完全支持XML(Simplexml扩展,新的DOM扩展,新的XSL扩展,把DOM-XML和XSLT移植到PECL等)移除了捆绑的MySQL客户端原创 2010-10-13 02:45:00 · 1221 阅读 · 0 评论 -
PEAR和PECL的区别及PCRE和POSIX的区别
/**************by garcon1986*******************/PEAR(PHP Extension and Application Repository)PHP扩展与应用程序库。PEAR是“一个可重用PHP组件的框架和发布系统”。PEAR可以下载、安装、升级及删除PHP脚本。使用PEAR包的时候,不必为了脚本的位置或者怎么找到它们而担心,扩展命令行接口(CLI)也很容易使用。PEAR是一个由社区推动的PHP项目,官方发布的PHP中就包含了PEAR。PECL原创 2010-10-13 02:54:00 · 2408 阅读 · 0 评论 -
HTML表格
PHP是服务端语言HTTP Hypertext Transfer Protocol访问网站时,浏览器向服务器发送一个请求如:GET / HTTP/1.1Host: example.org服务器向浏览器发送一个回复如:HTTP/1.1 200 OKContent-Type: text/htmlContent-Length: 419JavaScript执行在客户端,并不与PHP交流,因此也不需要继续发送HTTP请求。能把数据从PHP传输到JavaScrip原创 2010-10-13 03:11:00 · 491 阅读 · 0 评论 -
PHP CLI模式
<br />/***************by garcon1986***************/<br /> <br />首先,进入PHP的CLI(Command line interface) mode<br /><br />cyguin-> $ ./php --ini(显示配置文件信息)<br />将显示:<br />configuration file(php.ini) path: c:/Windows<br />Loaded configuration file: c:/wam原创 2010-09-11 11:19:00 · 4488 阅读 · 0 评论 -
php5概念总结之一
/***********by garcon1986*******************/1. $this变量是对当前对象的引用,$this->var; $this->method();2. php5中的变量和常量称为property,函数称为method.声明属性://invalidpublic $var = 'hel'.'lo';public $var2 = helloEOD;public $var3 = 1+2;public $var4 = self::Static原创 2010-08-12 20:42:00 · 735 阅读 · 0 评论 -
superglobals超全局变量之$GLOBALS, $_GET, $_POST, $_FILES, $_REQUEST, $_SESSION 等
<br />/*****************by garcon1986********************/<br /> <br /><?php<br /><br />//$GLOBALS — References all variables available in global scope<br />function test(){<br /> $x = 'local x';<br /> echo "global scope ".$GLOBALS['x']."<br原创 2010-08-06 09:15:00 · 1112 阅读 · 0 评论 -
Date/Time函数总结
/*************by Jiangong SUN*********************/ //set default timezonedate_default_timezone_set('Europe/Paris');echo date_default_timezone_get().''; //dayecho date('d-D-j-l-N-S-w-z')原创 2010-09-02 05:49:00 · 976 阅读 · 0 评论 -
reference引用
/***************by Jiangong SUN***************/ //$a =& $b;//$a和$b完全相等,指向了同一个内存地址。如果a改变了值,b也将改变值。//Note: $a and $b are completely equal here. $a is not pointing to $b or vice versa. $a and $原创 2010-08-06 04:15:00 · 709 阅读 · 0 评论 -
php换行符
/*****************by Jiangong SUN**********************/\t 水平tab\", \', \\ 特殊字符\n是换行,英文是linefeed,ASCII码是0xA\r是回车,英文是carriage return ,ASCII码是0xD 回车和换行的区别:\n, \r都是ascii码\n 换行是将光标移到下原创 2010-07-30 15:45:00 · 13949 阅读 · 2 评论 -
print_r 和var_dump的区别
/*************by Jiangong SUN******************/ The var_dump function displays structured information about variables/expressions including itstype and value. Arrays are explored recursively原创 2010-08-06 04:56:00 · 1993 阅读 · 0 评论 -
print和echo的区别
/**************By Jiangong SUN******************/print和echo的区别:1. echo可以输入多个字符串,而print不能。print "hello"."world"; //成功echo "hello"."world"; //成功print "hello","world"; //失败echo "hello","w原创 2010-09-14 04:55:00 · 843 阅读 · 0 评论 -
OOP初探
/**************by Jiangong SUN******************/ 面向对象的特点:继承(inheritance),多态(polymorphism),封装(encapsulation)缺点:1. 小项目中需要更多的代码;2. 执行稍慢 类就是对象的蓝图/模板Business logic 和 view logic 分离类的方法用于操作他自己原创 2010-09-16 07:31:00 · 538 阅读 · 0 评论 -
PHP print类函数总结
<?php /*************by garcon1986*********///print和echo的区别://1. echo可以输入多个字符串,而print不能。print "hello"."world"; //成功echo "hello"."world"; //成功//print "hello","world"; //失败echo "hello","world"; //原创 2010-03-26 00:45:00 · 900 阅读 · 0 评论 -
@操作符
/*By Jiangong SUN*/@$a = 1/0; @能不让错误代码显示,但是不能阻止错误的产生。因此使用它是危险的。 不是所有类型的错误都能被@获得并阻止。 php会先把代码解析成中间语言,用于更快的执行代码,但如果有语法错误,也会显示错误的。 如: @4sfa != sfa; Parse error: parse error in x原创 2010-07-30 22:34:00 · 794 阅读 · 0 评论 -
func_args函数
/**********by Jiangong SUN*************/ //func_num_args() return the numbers of parameters passed to a function//func_get_arg($arg_num) return a particular parameter //func_get_args() return原创 2010-08-03 18:54:00 · 720 阅读 · 0 评论 -
superglobals超全局变量之server
/**********by Jiangong SUN*******************/ //$_SERVER -- $HTTP_SERVER_VARS [deprecated] — Server and execution environment information//test url: http://localhost/superglobal.php?id=1&name原创 2010-08-06 08:41:00 · 807 阅读 · 0 评论 -
PHP中extract和addslashes的使用
/**************by garcon1986*************/extract 用法: "blue", "size" => "medium", "shape" => "sphere");extract($var_array, EXTR_PREFIX_SAME, "wddx");echo "$color, $size, $shape, $wddx_size/n";?>原创 2010-06-10 20:07:00 · 801 阅读 · 0 评论 -
变量变量和变量函数
<br />/**********by garcon1986***********/<br /><?php<br />//变量函数:当一个变量后有圆括号,php将寻找与变量的值同名的函数,并且尝试执行它。<br /><br />function toto(){<br /> echo "toto function";<br />}<br />$to = 'toto';<br />$to();<br />echo '<br />';<br /><br />function原创 2010-08-03 21:24:00 · 762 阅读 · 0 评论 -
Ubuntu linux下安装Eclipse PDT步骤
在Ubuntu Linux下进行PHP开发,首先可以安装搭建 LAMP 环境和 phpmyadmin 这个Mysql 数据库管理工具,之后选择一个FTP传工具如:Filezilla,最后我们还要选择PHP开发工具,Ubuntu自带的Gedit纯文本编辑做一般的代码文本的修改足够,但要实现一些项目和调试等功能就不行了,所以我们还是最好还是选择一款IDE开发环境,这里我们选择了Eclipse (PDT转载 2010-05-11 05:20:00 · 2040 阅读 · 0 评论 -
php 基础笔记 - boolean integer float
/***************************by garcon1986********************************/ <?php// boolean integer float example$action = false;if($action == "show version"){echo "the version is 123".原创 2010-02-12 23:23:00 · 678 阅读 · 0 评论 -
php 基础笔记 - array
/***************************by garcon1986********************************/ <?php// simple assgin the values$arr1 = array(12 => 10, sjg => yaya);echo $arr1[12].; // 10ech原创 2010-02-12 23:22:00 · 652 阅读 · 0 评论 -
php 基础笔记 - class
/***************************by garcon1986********************************/ <?php//简单示例class SimpleClass{public $var = a default value;public function displayVar(){echo $this->var;原创 2010-02-12 23:21:00 · 667 阅读 · 0 评论 -
php 基础笔记 - functions
/***************************by garcon1986********************************/ <?php//example1$makefoo = true;bar();if($makefoo){function foo(){echo "doesnt exist.";}}if($makefoo)原创 2010-02-12 23:20:00 · 523 阅读 · 0 评论 -
php 基础笔记 - variables
/***************************by garcon1986********************************/ <?php// variable name is sensitive$var = "sjg";$Var = "wl";echo $var. loves .$Var.;echo "$var, $Var";//原创 2010-02-12 23:17:00 · 647 阅读 · 0 评论 -
php基础笔记 - Arrow difference
/***************************by garcon1986********************************/ <?php// -> 是指对象的方法或者属性class Cart{public function add_item($a,$b){echo $a+$b.;}}//$cart = new Cart; 两句意义原创 2010-02-12 23:15:00 · 603 阅读 · 0 评论 -
php 基础笔记 - operators
/***************************by garcon1986********************************/ <?php//php avancé 5 example$a = hello;$a .= world;$table = users;$id = 5;$sql = SELECT * FROM.$tab原创 2010-02-12 23:12:00 · 516 阅读 · 0 评论 -
php 基础笔记 - logic statements
/***************************by garcon1986********************************/ <?php//if 语句$a = $b = 3;if($a = $b)print "a is equal to b";//else 语句if($a < $b){print "a is smaller th原创 2010-02-12 23:09:00 · 822 阅读 · 0 评论 -
php 基础笔记 - string
/***************************by garcon1986********************************/ <?php// example for strings, single quoted, double quotedecho display a string!;echo this displaysa spli原创 2010-02-12 23:24:00 · 621 阅读 · 0 评论 -
php二级联动菜单改动版
/**************************************************************************************************************************php二级联动菜单改动版*************************************************************原创 2010-02-12 23:27:00 · 1162 阅读 · 0 评论 -
PHP 目录函数总结
<?php /*********************************************************************** * 版权归garcon1986所有 * 受到法律的保护,任何公司或个人,未经授权不得擅自拷贝。 * @copyright Copyright: 2009-2010原创 2010-03-26 19:29:00 · 674 阅读 · 0 评论 -
Some arrangement on DOM
I have seen a good introducing article about Dom(Document Object Model): The purpose of this assignment was to learn how to use JavaScript with the DOM(D原创 2010-01-13 06:20:00 · 917 阅读 · 0 评论 -
20100318-PHP面试考试题总结
2010年3月18日面试考试题目及个人总结/*************by garcon1986*********************/1. Array_shift删除数组的第一个元素array_shift — Shift an element off the beginning of array<?php$stack = array ( "orange" , "ban原创 2010-03-19 23:21:00 · 1083 阅读 · 0 评论 -
Ubuntu安装php+apache+mysql
一、安装Apache2sudo apt-get install apache2然后在Firefox中打开:http://localhost/提示成功二、安装PHP5sudo apt-get install php5sudo apt-get install libapache2-mod-php5(根据俺的实际测试,这一步似乎不用做了,在上一步已经安装好了,不过还是建议转载 2010-03-23 02:50:00 · 1059 阅读 · 0 评论 -
去除字符串中的空格和重复内容
<?php error_reporting(E_ALL ^ E_NOTICE);$word = "google baidu baidu ALOOL baidu email google some piman";$word = preg_replace(//s+/, , $word);$_words = e原创 2010-03-04 17:48:00 · 1844 阅读 · 0 评论 -
PHP多维数组
/***************************by garcon1986********************************/ 一个三维数组的显示,保存以备以后使用。 <?phperror_reporting(E_ALL ^ E_NOTICE);$conn = mysql_connect("localhost","charles原创 2010-02-12 23:29:00 · 858 阅读 · 0 评论 -
PHP获取radio值,并用作参数查询数据库,同一页面显示
/***************************by garcon1986************************************/<?phperror_reporting(E_ALL ^ E_NOTICE);//create database test//create table php_radio(id int(10) NOT NULL AUTO_INC原创 2010-02-12 23:29:00 · 7285 阅读 · 0 评论 -
PHP上传
/***************************by garcon1986**************************/form.htmlUpload Fileuploader.php<?phpif($_FILES["uploadfile"]["size"] < 100000000){if($_FILES["upl原创 2010-02-12 23:28:00 · 1260 阅读 · 1 评论