Yii2.X 如何避开pathinfo不能处理中文名开头的bug
/**
* @return string original file base name
*/
public function getBaseName()
{
// https://github.com/yiisoft/yii2/issues/11012
return mb_substr(pathinfo('_' . $this->name, PATHINFO_FILENAME), 1, null, '8bit');
}
/**
* @return string file extension
*/
public function getExtension()
{
return strtolower(pathinfo($this->name, PATHINFO_EXTENSION));
}
浙公网安备 33010602011771号