Rumah >pembangunan bahagian belakang >tutorial php >类中调用自定义方法如何会Fatal error: Call to undefined function
类中调用自定义方法怎么会Fatal error: Call to undefined function
<br />class Template{<br /><br /> private $html;<br /> public $return;<br /><br /> function __construct($html)<br /> {<br /> $this->html = $html;<br /><br /> }<br /><br /> function cuts($text,$left,$right)<br /> {<br /> $re = rtrim(substr($text,$left,$right-$left));<br /> return $re;<br /> }<br /><br /> function conver()<br /> {<br /> $field_left = strpos($this->html,"}}") + 2;<br /> $field_right = strpos($this->html,"{{endlist}}");<br /> $tagin = cuts($this->html,$field_left,$field_right);<br /> print $tagin;<br /> $param_left = strpos($this->html,"((") + 2;<br /> $param_right = strpos($this->html,"))");<br /> $param = cuts($this->html,$param_left,$param_right);<br /> print $param;<br /><br /> }<br /><br />}<br />