Home >Backend Development >PHP Problem >How to remove file name suffix in php
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".
Recommendation: "PHP Video Tutorial"
php remove file name suffix (extension):
<?php $filename="help.php"; $filename=str_replace(strrchr($filename, "."),"",$filename); echo $filename; ?>
Output:
help
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!