Home > Backend Development > PHP Problem > How to remove file name suffix in php

How to remove file name suffix in php

藏色散人
Release: 2023-03-05 14:10:02
Original
2447 people have browsed it

php How to remove the suffix of a file name: First create a PHP sample file; then specify a file name; finally remove the suffix of the specified file name through functions such as "str_replace".

How to remove file name suffix in php

Recommendation: "PHP Video Tutorial"

php remove file name suffix (extension):

<?php 
$filename="help.php"; 
$filename=str_replace(strrchr($filename, "."),"",$filename); 
echo $filename; 
?>
Copy after login

Output:

help
Copy after login

The above is the detailed content of How to remove file name suffix in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template