本文整理汇总了PHP中Zip::getRelativePath方法的典型用法代码示例。如果您正苦于以下问题:PHP Zip::getRelativePath方法的具体用法?PHP Zip::getRelativePath怎么用?PHP Zip::getRelativePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zip
的用法示例。
在下文中一共展示了Zip::getRelativePath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: relPath
/**
* Clean up a path
* If the path starts with a "/", it is deemed absolute and any /../ in the beginning is stripped off.
* The returned path will not end in a "/".
*
* @param String $relPath The path to clean up
* @return String the clean path
* @deprecated Redundant, please use Zip::getRelativePath($relPath) instead.
*/
function relPath($relPath)
{
return Zip::getRelativePath($relPath);
}
示例2: normalizeFileName
/**
* Cleanup the filepath, and remove leading . and / characters.
*
* Sometimes, when a path is generated from multiple fragments,
* you can get something like "../data/html/../images/image.jpeg"
* ePub files don't work well with that, this will normalize that
* example path to "data/images/image.jpeg"
*
* @param string $fileName
* @return string normalized filename
*/
function normalizeFileName($fileName)
{
return preg_replace('#^[/\\.]+#i', "", Zip::getRelativePath($fileName));
}