首頁 >後端開發 >php教程 >类中调用自定义方法如何会Fatal error: Call to undefined function

类中调用自定义方法如何会Fatal error: Call to undefined function

WBOY
WBOY原創
2016-06-13 12:05:501330瀏覽

类中调用自定义方法怎么会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 />


Fatal error: Call to undefined function cuts()

为毛会出现这种情况
------解决方案--------------------
$param = $this->cuts($this->html,$param_left,$param_right);

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn