$name = substr($name, 0, -strlen($ext)) . "_medium." . end(explode('.',$name));
上面的代码报告了标准警告,小脚本如下:
function medium($name) {
$ext = strrchr($name, '.');
if($ext !== false) {
$name = substr($name, 0, -strlen($ext)) . "_medium." . end(explode('.',$name));
}
return $name;
}
function thumb($name) {
$ext = strrchr($name, '.');
if($ext !== false) {
$name = substr($name, 0, -strlen($ext)) . "_thumb." . end(explode('.',$name));
}
return $name;
}
function name_remove($name) {
$name = str_replace("_medium", "", $name);
$name = str_replace("_thumb", "", $name);
return $name;
}
我该如何解决这个警告?需要帮忙 :)