-1

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?

Beta Pubb
  • 11
  • 1

2 Answers2

1

You can try this

$filename=basename($pathinfo);
$final_filename=str_replace('_','',$filename);
GolezTrol
  • 114,394
  • 18
  • 182
  • 210
SattyamBhatt
  • 338
  • 2
  • 13
0

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();

GolezTrol
  • 114,394
  • 18
  • 182
  • 210
Muhammad Awais
  • 463
  • 1
  • 6
  • 17