<?php
class Person {
public $name = ' '; function name($newname = NULL) {
if (!is_null($newname)) {
$this->name = $newname;
}
return $this->name;
}
}
$ed = new Person;
$ed->name( 'Edison ');
printf("Hello,%s\n. <br >",$ed->name);
$tc = new Person;
$tc->name( 'Crapper ');
printf("Look out below %s\n. <br >",$tc->name);
?>
class Person {
public $name = ' '; function name($newname = NULL) {
if (!is_null($newname)) {
$this->name = $newname;
}
return $this->name;
}
}
$ed = new Person;
$ed->name( 'Edison ');
printf("Hello,%s\n. <br >",$ed->name);
$tc = new Person;
$tc->name( 'Crapper ');
printf("Look out below %s\n. <br >",$tc->name);
?>
解决方案 »
- 定义端口问题?
- 正则是我永远的痛啊。。。
- explode遇到大小写的问题
- 小弟学习过程中遇难:mysql的唯一约束对PHP的影响
- 我的服务器用FTP上传东西时可以写入,为什么用PHP使用$_FILE文件就传不上去.
- 为什么建立不了数据库,错在哪里?帮帮新手!谢谢!
- PHP中显示数据的一个非常难题!!
- 在php中,要实现如下的强大搜索功能,各位有不同有现成的代码,给我一份啊,email:[email protected],先谢谢了,
- 各位大虾,请帮我看看,这是数据库的错还是session的错?
- php的文件处理函数用法?
- 数据库复制
- 问个超新手弱智问题,linux系统下,开发PHP用什么?也是dreamweaver吗?
谢谢啊...