当我尝试使用strtolower()
我的字符串时出现以下错误:
Warning: strtolower() expects parameter 1 to be string, object given in
当我这样做时,var_dump()
它告诉我字符串应该是一个字符串?
string(21) "This IS a Test String"
一些代码:
protected $hostname;
public function __construct($hostname)
{
//$this->hostname = $hostname;
$this->hostname = 'This IS a TeSt String';
return $this->_filter();
}
private function _filter()
{
$hostname = $this->hostname;
var_dump($hostname);
$hostname = strtolower($hostname);
$hostname = $this->_getDomain($hostname);
$hostname = $this->_stripDomain($hostname);
return $hostname;
}
提前致谢!