pclziputilrename

函式
pclziputilrename ( $p_src, $p_dest )

pclziputilrename: 這個函式重新命名一個檔案或目錄。它需要三個引數。$p_archive(物件)表示存檔,$p_src(字串)表示源路徑,$p_dest(字串)表示目標路徑。

function PclZipUtilRename($p_src, $p_dest)
  {
    $v_result = 1;

    // ----- Try to rename the files
    if (!@rename($p_src, $p_dest)) {

      // ----- Try to copy & unlink the src
      if (!@copy($p_src, $p_dest)) {
        $v_result = 0;
      }
      else if (!@unlink($p_src)) {
        $v_result = 0;
      }
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : PclZipUtilOptionText()
  // Description :
  //   Translate option value in text. Mainly for debug purpose.
  // Parameters :
  //   $p_option : the option value.
  // Return Values :
  //   The option text value.
  // --------------------------------------------------------------------------------

常見問題

FAQs
檢視更多 >