我在 php 7.3 中出現了這個錯誤不推薦使用:strpos():非字符串指針將來會被解釋為字符串。使用顯式 chr() 調用來保留當前行為該行是:if ($this->Category->getPath() && strpos('_', $this->Category->getPath())) {它似乎來自這個代碼: strpos('_', $this->Category->getPath()$this->Category->getPath() 可以返回這個值,例如:int(8)
string(3) "8_9"
2 回答

白豬掌柜的
TA貢獻1893條經驗 獲得超10個贊
這對我有用
$suffix = strval($this->config->item('controller_suffix'));
$pos = !empty($suffix) ? strpos($class, $suffix) : FALSE;
if ($pos === FALSE)
{
$class .= $suffix;
}
parent::set_class($class);
- 2 回答
- 0 關注
- 273 瀏覽
添加回答
舉報
0/150
提交
取消