有问题
class printnmae
{  
    var $name;
    function show_name()
    {
    echo \n";
  echo "The name is $this->name.","\n","\n";
    echo "hellp! $this->name!","\n";"\n";
    }
}

解决方案 »

  1.   

    class printnmae
    {  
        var $name;
        function show_name()
        {
        echo \n";
      echo "The name is $this->name.","\n","\n";
        echo "hellp! $this->name!","\n";"\n";
        }
    }在类的函数里面如果要调用当然类的变量一般要加上$this关键字,如果楼主对类不太熟悉的话可以看看thinking in java这本书,里面讲得很清楚
      

  2.   

    应该是This is name $this->name,hello $this->name
      

  3.   

    应该是This is name $this->name,hello $this->name