gde_split_filename
The WordPress Core gde split filename function.
Description
gde_split_filename( (string) $filename );
Parameters (1)
- 0. $filename (string)
- The filename.
Usage
if ( !function_exists( 'gde_split_filename' ) ) { require_once '/functions.php'; } // The filename. $filename = ''; // NOTICE! Understand what this does before running. $result = gde_split_filename($filename);
Defined (1)
The function is defined in the following location(s).
- /functions.php
- function gde_split_filename( $filename ) {
- $pos = strrpos( $filename, '.' );
- if ( $pos === false ) {
- return array( $filename, '' ); // no extension (dot is not found in the filename)
- } else {
- $basename = substr( $filename, 0, $pos );
- $ext = substr( $filename, $pos + 1 );
- return array( $basename, $ext );
- }
- }