标签:
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <title>无标题文档</title> 6 </head> 7 8 <body> 9 10 <?php 11 12 //include("../china.php"); 13 //require_once "../China.php"; 14 15 16 function __autoload($classname) 17 { 18 require_once $classname . ‘_class.php‘; 19 } 20 21 22 23 $ren = new Ren(); 24 $ren->name="张三"; 25 $ren->Eat(); 26 27 28 ?> 29 30 </body> 31 </html>
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <title>无标题文档</title> 6 </head> 7 8 <body> 9 10 <?php 11 12 class Ren 13 { 14 var $name ; 15 var $age; 16 17 function Eat() 18 { 19 echo "{$this->name}正在吃饭"; 20 } 21 22 function __clone() 23 { 24 $this->name = "李四"; 25 } 26 27 } 28 29 30 31 ?> 32 33 34 </body> 35 </html>
标签:
原文地址:http://www.cnblogs.com/sihuiming/p/5205175.html