pclziputiltranslatewinpath

函式
pclziputiltranslatewinpath ( $p_path, $p_remove_disk_letter = true )

pclziputiltranslatewinpath: 這是WordPress中的一個函式,是PclZip庫的一部分。它用來把Windows路徑翻譯成Unix路徑,用正斜線替換反斜線: 當在使用基於Unix作業系統的伺服器上處理檔案時,這很有用。

function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true)
  {
    if (stristr(php_uname(), 'windows')) {
      // ----- Look for potential disk letter
      if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) {
          $p_path = substr($p_path, $v_position+1);
      }
      // ----- Change potential windows directory separator
      if ((strpos($p_path, '\') > 0) || (substr($p_path, 0,1) == '\')) {
          $p_path = strtr($p_path, '\', '/');
      }
    }
    return $p_path;
  }
  // --------------------------------------------------------------------------------


?>

常見問題

FAQs
檢視更多 >