PHP Classes

File: classes/fileparser.php

Recommend this page to a friend!
  Classes of stefan   PHP XML Converter   classes/fileparser.php   Download  
File: classes/fileparser.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP XML Converter
Transform Indesign to eBundesanzeiger XML format
Author: By
Last change:
Date: 1 year ago
Size: 744 bytes
 

Contents

Class file image Download
<?php
Class FileParser {

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
   
public static function splitFilename($filename) {
       
$pos = strrpos($filename, '.');
        if (
$pos === false)
        {
// dot is not found in the filename
           
return array($filename, ''); // no extension
       
}
        else
        {
           
$basename = substr($filename, 0, $pos);
           
$extension = substr($filename, $pos+1);
            return array(
$basename, $extension);
        }
    }
   
    public static function
getExtension($filename) {
       
$filesplit = self::splitFilename($filename);
        return
$filesplit[1];
    }
}
?>