Todaymade\Daux\Tree\Builder::removeSortingInformations PHP Method

removeSortingInformations() public static method

public static removeSortingInformations ( string $filename ) : string
$filename string
return string
    public static function removeSortingInformations($filename)
    {
        preg_match('/^-?[0-9]*_?(.*)/', $filename, $matches);
        // Remove the numeric part
        // of the filename, only if
        // there is something after
        return empty($matches[1]) ? $matches[0] : $matches[1];
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Get the possible output file names for a source file.
  *
  * @param Config $config
  * @param string $part
  * @return string[]
  */
 public static function getFilenames(Config $config, $part)
 {
     $extensions = implode('|', array_map('preg_quote', $config['valid_content_extensions'])) . '|html';
     $raw = preg_replace('/(.*)?\\.(' . $extensions . ')$/', '$1', $part);
     $raw = Builder::removeSortingInformations($raw);
     return ["{$raw}.html", $raw];
 }
All Usage Examples Of Todaymade\Daux\Tree\Builder::removeSortingInformations