删除文件扩展名和下划线[重复]

This question already has an answer here:

Is that possible to remove the file extension type from file name and underscore? For example: File name is MTK_USB_All_v1.0.1.zip But I want to show it as

MTK USB All v1.0.1

Ex: https://androiddatahost.com/upload/Amomp

Right now Im using

<?php echo $name; ?>

to show the file name. I also want to show the alternate name of the file without file extension and underscore.

Is that possible?

</div>

To Show only the Filename you can use pathinfo.

$filename = pathinfo('filename.zip', PATHINFO_FILENAME); 

To replace underscore with blank space you can use str_replace();

You can try this

$filename=basename($pathinfo);
$final_filename=str_replace('_','',$filename);