安装 Eclipse PHP Plugin:
http://www.phpchina.com/html/78/78-7023.html
PDT- PHP Development Tools:http://download.eclipse.org/tools/php/updates/
Zend Studio for Eclipse:
使用Eclipse PDT+WAMP开发PHP:http://devsharp.iteye.com/blog/157140
Eclipse PHP Development Tools:http://www.zend.com/community/pdt?ecl=EclipseZend
配置 PHP Plugin:
http://blog.chinaunix.net/u1/52953/showart_1795939.html
配置环境:
配置教程:
http://hi.baidu.com/%C9%F1%C7%B9%CA%D6/blog/item/a212e817dac29c0ec83d6dfc.html
http://hi.baidu.com/62001/blog/item/f3f9cf2a94f48492023bf6fb.html
代码格式:
<? . . . ?> <?php . . . ?> <script language="php"> . . . </script> <% . . . %>
数据类型:
boolean(布尔型) TRUE FALSE
integer(整型)
float(浮点型)/double
string(字符串)
array(数组):
// 赋值 $bo=array(1, 2, 3, 4); $bo=array("A"=>1, "B"=>2) // 取值 $bo['A'] = 1 // 使用 count 函数统计数组条数: count ( $arr ); // 使用 is_array函数判断数组 is_array ( $arr ); // 另一种创建数组的函数explode: explode ( "key" , value); $a = "1986-1983-1980"; $arr = explode("-", $a); print_r($arr); // 输出:Array ( [0] => 1986 [1] => 1983 [2] => 1980 ) // 使用foreach 遍历数组 foreach ( $arr as $key => $value ){ // …… } $arr = array(1980, 1982, 1983, 1984, 1985); foreach($arr as $key=>$value) { //“$key=>”可以省略 echo($value); echo("-"); echo($key); echo("<br>"); } // 输出: // 1980-0 // 1982-1 // 1983-2 // 1984-3 // 1985-4
运算类型介绍与应用:
比较运算:
// 数值类型 和 数值值都一样才成立 1 === "1"
PHP 循环语句的介绍与应用:
break; //跳出一层循环 break n; //跳出N层循环
自定义函数:
function _pr($val, $val2 = 1) { $a = $val + $val2; return $a; } $a = _pr(6, 8);
引用返回值使用&符号:
function _pr(&$val, $val2 = 1) { $a = $val + $val2; return $a; }