在php中怎样创建一个构造函数
1、打开编辑器,为这个程序写上注释内容。#php中如何创建一个构造函数

3、然后利用__construct来创建一个类。function __construct($name,$age){

5、然后实例化一个对象。$t1=new test1();

7、打开浏览器进行测试,输入地址http://localhost/nodepad/new%201.php

1、打开编辑器,为这个程序写上注释内容。#php中如何创建一个构造函数
3、然后利用__construct来创建一个类。function __construct($name,$age){
5、然后实例化一个对象。$t1=new test1();
7、打开浏览器进行测试,输入地址http://localhost/nodepad/new%201.php