You are here

function phpexcel_munge_filename in PHPExcel 7.3

Same name and namespace in other branches
  1. 8.3 phpexcel.inc \phpexcel_munge_filename()
  2. 7.2 phpexcel.inc \phpexcel_munge_filename()

Munges the filename in the path.

We can't use drupals file_munge_filename() directly because the $path variable contains the path as well. Separate the filename from the directory structure, munge it and return.

Parameters

string $path:

Return value

string

8 calls to phpexcel_munge_filename()
PHPExcelTest::testCustomMethodCalls in tests/phpexcel.test
Test the ability to pass custom methods and arguments on import.
PHPExcelTest::testDBResultExport in tests/phpexcel.test
Test db_result export.
PHPExcelTest::testIgnoreHeaders in tests/phpexcel.test
Test "ignore_headers" option.
PHPExcelTest::testIssue1988868 in tests/phpexcel.test
A cell with a value of '0' must get exported as such.
PHPExcelTest::testMultipleWorksheetExport in tests/phpexcel.test
Test multiple worksheet Excel export.

... See full list

File

./phpexcel.inc, line 568
Defines the phpexcel api functions that other modules can use.

Code

function phpexcel_munge_filename($path) {
  $parts = explode(DIRECTORY_SEPARATOR, $path);
  $filename = array_pop($parts);
  return implode(DIRECTORY_SEPARATOR, $parts) . DIRECTORY_SEPARATOR . file_munge_filename($filename, 'xls xlsx csv ods');
}