|
|
|
|
|
| <?php
function remove_extension($filename) {
return preg_replace('/(.+)\..*$/', '$1', $filename);
}
?> | |
Example Usage
| <?php
// Prints 'header'
echo remove_extension("header.php");
?> | |
To see an exmaple of how to get the extension instead of the file name :
http://www.weberdev.com/get_example-4609.html |
|
| Validating a URL with preg_match Categories : PHP, Regexps, Beginner Guides, Data Validation | | | PHP based HTML rabbing Tools Categories : PHP, HTML and PHP, Tag Extractors, Regexps, Beginner Guides | | | Newbie Notes #7 - Ridiculous regex Categories : PHP, Beginner Guides, Regexps | | | Grab links from a page Categories : PHP, Regexps, HTTP | | | Calculate Body Mass Index Categories : PHP, Algorithms, Regexps | | | How to Insert a Date Format Into MySQL from PHP Categories : PHP, Databases, MySQL, Date Time, Beginner Guides | | | Match words that are entered into a <textarea> in any layout orientation (horizontal, vertical, diagonal). Categories : PHP, Regexps | | | My Box - PHP Class that calculates the volumetric weight of a package.
Categories : PHP, Object Oriented, PHP Classes, Beginner Guides, Payment Gateways | | | Random text quote Categories : PHP, Arrays, Beginner Guides | | | An array of functions to use in checking user input to HTML forms : text, firstName, middleNameOrInit, lastName, email, web, digits, decimal, hex, genNum, USD, BPS, Euro, USphone, USzip Categories : PHP, Data Validation, Regexps | | | Creating a Language File Categories : PHP, Beginner Guides, Filesystem | | | session out Timer Categories : PHP, Sessions, Security, Beginner Guides | | | Human readable PHP password generator Categories : PHP, Security, Beginner Guides, Arrays | | | making links from text Categories : PHP, Regexps, Email | | | Banknote Validation - A PHP class that provides several methods to quickly validate banknote serial numbers of the following currencies: AUD, CAD, CHF, CNY, EUR, GBP, JPY, USD.
Categories : PHP, PHP Classes, Data Validation, Regexps | |
| |
| |
|