是这样的,楼主可以参照http://cn2.php.net/manual/zh/function.dom-domcomment-construct.php这个PHP手册的范例,PHP手册的范例是绝对没有错误的。
解决方案 »
- 我想在http://www.laoyuji.com/页头空白处定义一个图片区域
- zend studio9.0.0如何无限期使用
- 关于用php mail函数发送带附件的邮件
- 请大家来帮忙,斑竹请看看
- 一个非常难搞的循环(很急)
- 如何用php开发网页
- 18:44:37 Apr 11, 2007 PDT 这种时间格式要怎么转化为datetime格式呢?谢谢先!
- PHPLIB这个错误大概是什么原因引起的?
- 请问在APACHE里,怎样让PHP文件info.php正常显示出来啊?
- mysql的两个join和while性能分析
- 请问PHP如何分析mail文件,格式为.msg。
- bind_param(): Number of elements in type definition string doesn't match number of bind variables in数据库连接错误
$element = $dom->appendChild(new DOMElement('root'));
$comment = $element->appendChild(new DOMComment('root comment'));
echo $dom->saveXML(); /* <?xml version="1.0" encoding="iso-8859-1"?><root><!--root comment--></root> */?>范例是这样写参数的,所以楼主的方法是正确的
class Person {
private $name;
/**
* Php5 构造函数写法
* @param String $name
*/
public function __construct($name) {
$this->name = $name;
}
/**
* 4中的写法
* @param String $name
*/
/**
public function Person($name){
$this->name = $name;
}
*/
public function getName(){
return $this->name;
}
}
$person = new Person('PersonA');
echo $person->getName();
?>