gde_split_filename

The Google Doc Embedder gde split filename function.

Description

gde_split_filename( (string) $filename ); 

Parameters (1)

0. $filename (string)
The filename.

Usage

  1. if ( !function_exists( 'gde_split_filename' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/functions.php'; 
  3.  
  4. // The filename. 
  5. $filename = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gde_split_filename($filename); 
  9.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function gde_split_filename( $filename ) { 
  2. $pos = strrpos( $filename, '.' ); 
  3. if ( $pos === false ) { 
  4. return array( $filename, '' ); // no extension (dot is not found in the filename) 
  5. } else { 
  6. $basename = substr( $filename, 0, $pos ); 
  7. $ext = substr( $filename, $pos + 1 ); 
  8. return array( $basename, $ext );