Home >Backend Development >PHP Tutorial >类中调用自定义方法如何会Fatal error: Call to undefined function

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

WBOY
WBOYOriginal
2016-06-13 12:05:501331browse

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn