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

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

WBOY
Release: 2016-06-13 12:05:50
Original
1347 people have browsed it

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


Fatal error: Call to undefined function cuts()

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template