Hello buddies and merry christmas
I have a string which is a file name with multi parts (my file.part001) I need to remove the (.part001) form the string so only the (my file) still.
I've tried
function removeFromEnd($string, $Remove) {
$RemoveLen = strlen($Remove);
$stringLen = strlen($string);
$pos = $stringLen - $RemoveLen;
$out = substr($string, 0, $pos);
return $out;
}
but the problem I have numbers after (part) string
how to do somthing like this so any file with (part01)(part001)(part0001) witll be removed.