Home > Backend Development > PHP Tutorial > php文件服务实现虚拟挂载其他目录示例_PHP

php文件服务实现虚拟挂载其他目录示例_PHP

WBOY
Release: 2016-06-01 11:54:45
Original
1055 people have browsed it

php文件服务实现虚拟挂载其他目录

复制代码 代码如下:
function base64url_encode($data) {
  return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}
function base64url_decode($data) {
  return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
}
function array_verify($var)
  {
   return isset($var)&&is_array($var) && count($var)>0;
  }
  function format_file_size($var)
  {
   if($var   if($var   if($var   return ($var/1073741824.0).' G';
  }

  $dir="F:";//不以/结尾
  $path="";

 if(array_verify($_GET)&&isset($_GET["path"]))
 {
  $path=base64url_decode($_GET["path"]);
  preg_match("#^[^/].*$|^.*\.$|^\..*$|\./\.|/\.|\./#",$path,$temp);
    if(array_verify($temp))
   {
    echo
      '
              


              
               ';
           echo "璀
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template