PHP 7 Script to Remove Extension From Filename Using substr() and strrpos() Functions Full Project For Beginners

  • Post author:
  • Post category:PHP
  • Post comments:0 Comments

 

Welcome folks today in this blog post we will be removing extension from filename using substr() and strrpos() functions in php 7. All the full source code of the application is shown below.

 

 

 

Get Started

 

 

 

In order to get started you need to make an index.php file and copy paste the following code

 

 

index.php

 

 

$filename = 'filename.php'; 
$filename_without_ext = substr($filename, 0, strrpos($filename, "."));

Leave a Reply