- 浏览: 113308 次
- 性别:
- 来自: 北京
最新评论
-
ulric:
第一个函数的for循环应该从0开始
判断一个字符串是否为回文 -
ocaicai:
c语言的影子比较重啊!呵呵O(∩_∩)O~
java实现约瑟夫环问题 -
烟的傀儡:
通俗易懂!!太棒了
java实现约瑟夫环问题 -
eachcan:
中等什么意思?非常小是多大?写文章请负点责任。
基础知识:MySQL数据类型及列类型 (1) -
rorely:
谢谢,少加了一个条件。呵呵。更正好了
编程实现“加3减3乘3除3”
文章列表
clone方法的使用,浅拷贝对象。示例如下:
<?php
class Foo{
private $x;
private $y;
public function setX($x){
$this->x=$x;
}
public function setY($y){
$this->y=$y;
}
public function getX(){
return $this->x;
...
- 2009-06-28 10:59
- 浏览 453
- 评论(0)
构造函数:constructor
析构函数:destructor
在php5.1中,构造函数统一命名为:
function __construct(){
#函数体
}
析构函数统一命名为:
function __destruct(){
#函数体
}
注意,construct和destruct之前有两个下划线,不是一个
下面给出一个构造函数的示例:
<?php
class Car{
private $color;
private $size;
private $price;
function __cons ...
- 2009-06-28 09:53
- 浏览 506
- 评论(0)
构造函数:constructor
析构函数:destructor
在php5.1中,构造函数统一命名为:
function __construct(){
#函数体
}
析构函数统一命名为:
function __destruct(){
#函数体
}
注意,construct和destruct之前有两个下划线,不是一个
下面给出一个构造函数的示例:
<?php
class Car{
private $color;
private $size;
private $price;
function __cons ...
- 2009-06-28 09:53
- 浏览 661
- 评论(0)
在php中,只有对象类型和数组类型,可以在定义函数的时候,在形参中添加类型提示。例如:
<?php
class MyClass{
public $var="这里用了类型提示";
}
#类型提示,只能够是对象和数组类型。
#对象
function MyFunction(MyClass $foo){
echo $foo->var;
}
$myClass=new MyClass;
MyFunction($myClass);
#数组
$arr=array("Jane" ...
- 2009-06-28 09:46
- 浏览 711
- 评论(0)
在php中,只有对象类型和数组类型,可以在定义函数的时候,在形参中添加类型提示。例如:
<?php
class MyClass{
public $var="这里用了类型提示";
}
#类型提示,只能够是对象和数组类型。
#对象
function MyFunction(MyClass $foo){
echo $foo->var;
}
$myClass=new MyClass;
MyFunction($myClass);
#数组
$arr=array("Jane" ...
- 2009-06-28 09:46
- 浏览 505
- 评论(0)
<?xml version="1.0" encoding="UTF-8" ?>
<Configuration>
<Name>CDU</Name>
<Type>University</Type>
<Number>20000</Number>
<Department>12</Department>
<DBA>
<UserName>rorely</UserNa ...
- 2009-06-24 10:57
- 浏览 2089
- 评论(0)
变量命名中的[匈牙利命名法][骆驼命名法][帕斯卡(pascal)命名法]
转自:http://hi.baidu.com/toughguy/blog/item/1599b3032334b5753912bba1.html
一、匈牙利命名法:广泛应用于象Microsoft Windows这样的环境中。
Windows 编程中用到的变量(还包括宏)的命名规则匈牙利命名法,这种命名技术是由一位能干的 Microsoft 程序员查尔斯·西蒙尼(Charles Simonyi) 提出的。
匈牙利命名法通过在变量名前面加上相应的小写字母的符号标识作为前缀,标识出变量的作用域,类型等。这些符 ...
- 2009-06-21 00:16
- 浏览 809
- 评论(0)
a 数组
b bool(int)
by unsigned char(byte)
c char
cb 字节计数
cr 颜色引用值
cx,cy short(count of x,y length)
dw unsigned long(dword)双字
fn 函数
h 句柄
i interger
m 类的数据成员
n short或int ...
- 2009-06-21 00:08
- 浏览 667
- 评论(0)