最新赞助活动温馨提示:自愿赞助服务器费用,学生和没有工作的整站资源免费下载!
头像

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

来源:http://erdangjiade.com/topic/79761.html 你好,世界。 2017-10-04 21:03浏览(2)

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

class Template{

private $html;
public $return;

function __construct($html)
{
$this->html = $html;

}

function cuts($text,$left,$right)
{
$re = rtrim(substr($text,$left,$right-$left));
return $re;
}

function conver()
{
$field_left = strpos($this->html,"}}") + 2;
$field_right = strpos($this->html,"{{endlist}}");
$tagin = cuts($this->html,$field_left,$field_right);
print $tagin;
$param_left = strpos($this->html,"((") + 2;
$param_right = strpos($this->html,"))");
$param = cuts($this->html,$param_left,$param_right);
print $param;

}

}


Fatal error: Call to undefined function cuts()

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

评论0
头像

友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群

1 2