當前位置: 首頁>>代碼示例>>PHP>>正文


PHP move函數代碼示例

本文整理匯總了PHP中move函數的典型用法代碼示例。如果您正苦於以下問題:PHP move函數的具體用法?PHP move怎麽用?PHP move使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了move函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: move

/**
 * Scripts that can move submission files from the database to the filesystem and back
 */
function move($entity, $submission_path)
{
    copy_submissions_for_entity($entity, $submission_path . $entity->path());
    foreach ($entity->children() as $child) {
        move($child, $submission_path);
    }
}
開發者ID:jlsa,項目名稱:justitia,代碼行數:10,代碼來源:move_submission_data.php

示例2: uploaddelete

function uploaddelete($fd_cat_id)
{
    $db = new DB_test();
    move($fd_cat_id);
    //調用回收舊數據函數
    $query = "delete  from tb_upload_category_list where fd_cat_id='{$fd_cat_id}'";
    $db->query($query);
}
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:8,代碼來源:UploadAction.php

示例3: hanoi

function hanoi($n, $from, $transfrom, $to, &$path)
{
    if ($n == 1) {
        move(1, $from, $to, $path);
    } else {
        hanoi($n - 1, $from, $to, $transfrom, $path);
        move($n, $from, $to, $path);
        hanoi($n - 1, $transfrom, $from, $to, $path);
    }
}
開發者ID:dalonghahaha,項目名稱:algorithm,代碼行數:10,代碼來源:Hanoi.php

示例4: removeFilepath

function removeFilepath($id)
{
    $dbfile = new DB_file();
    move($id);
    //調用回收舊數據函數
    $query = "delete from  tb_category_list where fd_cat_id='{$id}'";
    $dbfile->query($query);
    //把舊圖片移走
    $returnvalue = "success";
    return $returnvalue;
}
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:11,代碼來源:AutoGetFilepath.php

示例5: move

function move($n, $a, $b, $c)
{
    if ($n == 1) {
        echo $a . ' -> ' . $c . ' <br/>';
    } else {
        move($n - 1, $a, $c, $b);
        //第n-1個要從a通過c移動到b
        echo $a . ' -> ' . $c . ' <br/>';
        move($n - 1, $b, $a, $c);
        //n-1個移動過來之後b變開始盤,b通過a移動到c,這邊很難理解
    }
}
開發者ID:test1960,項目名稱:work,代碼行數:12,代碼來源:Hanoi.php

示例6: build_status_tree

function build_status_tree(&$status_tree, $actions, &$begin_index, &$finish)
{
    $begin = $begin_index;
    $end = count($status_tree);
    $begin_index = count($status_tree);
    for ($i = $begin; $i < $end; $i++) {
        if ($status_tree[$i]['end']) {
            continue;
        }
        move($status_tree, $i, $actions);
    }
    if (count($status_tree) == $end) {
        $finish = true;
    }
}
開發者ID:dalonghahaha,項目名稱:algorithm,代碼行數:15,代碼來源:MonksAndMonsters.php

示例7: move2

function move2($old, $new, $table2, $column, $safe)
{
    global $mysqli;
    move($old, $safe, $table2, $column);
    $stmt = $mysqli->prepare("UPDATE {$table2} SET {$column} = {$column} + 1 WHERE {$column} >= ? AND {$column} < ?");
    if (!$stmt) {
        echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error;
    }
    sql_exec($stmt, ["ii", $new, $old]);
    $stmt = $mysqli->prepare("UPDATE {$table2} SET {$column} = ? WHERE {$column} = ?");
    if (!$stmt) {
        echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error;
    }
    sql_exec($stmt, ["ii", $new, $safe]);
    $stmt->close();
}
開發者ID:NasalMusician,項目名稱:Pantheum,代碼行數:16,代碼來源:db_reorder.php

示例8: generateSimulationArray

function generateSimulationArray($dimension, $startNrC, $startNrH, $startNrP)
{
    $_SESSION["dimension"] = $dimension;
    $simulationArray = array();
    $simulationday = generateDay0($startNrC, $startNrH, $startNrP);
    $simulationArray[] = $simulationday;
    do {
        $simulationeaten = eat($simulationday);
        $simulationloved = love($simulationeaten);
        $simulationfaught = fight($simulationloved);
        $simulationmoved = move($simulationfaught);
        $simulationspawned = spawnOnePlant($simulationmoved);
        $simulationday = $simulationspawned;
        $simulationArray[] = $simulationday;
    } while (count($simulationday) - count(array_keys($simulationday, null)) < $dimension ** 2);
    return $simulationArray;
}
開發者ID:Undeci,項目名稱:Scrum,代碼行數:17,代碼來源:simulationFunctions.php

示例9: travel

function travel($endX, $endY, $limit)
{
    global $map, $currentX, $currentY;
    $map[$currentX][$currentY] = 0;
    $move = 1;
    while ($move <= $limit) {
        move($move);
        if ($currentX == $endX && $currentY == $endY) {
            echo "Congratulation!<br />";
            break;
        } else {
            if ($move == $limit) {
                echo "Sorry, not found!<br />";
            }
        }
        $move++;
    }
}
開發者ID:phoe721,項目名稱:phoe721.com,代碼行數:18,代碼來源:moves.php

示例10: simulate

 public function simulate()
 {
     $_SESSION["dimension"] = $_POST["dimension"];
     $_SESSION["startNrPlants"] = $_POST["startNrPlants"];
     $_SESSION["startNrCarnivores"] = $_POST["startNrCarnivore"];
     $_SESSION["startNrHerbivores"] = $_POST["startNrHerbivore"];
     if ($_SESSION["startNrPlants"] + $_SESSION["startNrCarnivores"] + $_SESSION["startNrHerbivores"] > $_SESSION["dimension"] ** 2) {
         header('location:index_tmp.php?toocrowded=true');
         exit(0);
     }
     $day = 0;
     do {
         for ($i = 0; $i < $_SESSION["dimension"] ** 2; $i++) {
             $_SESSION["action"][] = false;
         }
         if ($day == 0) {
             $simulation[$day] = generateDay0();
             $simMatrix[$day] = array_chunk($simulation[$day], $_SESSION["dimension"]);
             for ($i = 0; $i < $_SESSION["dimension"]; $i++) {
                 for ($j = 0; $j < $_SESSION["dimension"]; $j++) {
                     if ($simMatrix[$day][$i][$j]) {
                         $_SESSION["simData"][] = array('dimension' => $_SESSION["dimension"], 'day' => $day, 'posx' => $i, 'posy' => $j, 'type' => $simMatrix[$day][$i][$j]['type'], 'lifeforce' => $simMatrix[$day][$i][$j]['life']);
                     }
                 }
             }
         }
         $day++;
         $simulation[$day] = $simulation[$day - 1];
         $simulation[$day] = eat($simulation[$day]);
         $simulation[$day] = love($simulation[$day]);
         $simulation[$day] = fight($simulation[$day]);
         $simulation[$day] = move($simulation[$day]);
         $simulation[$day] = spawnOnePlant($simulation[$day]);
         $simMatrix[$day] = array_chunk($simulation[$day], $_SESSION["dimension"]);
         for ($i = 0; $i < $_SESSION["dimension"]; $i++) {
             for ($j = 0; $j < $_SESSION["dimension"]; $j++) {
                 if ($simMatrix[$day][$i][$j]) {
                     $_SESSION["simData"][] = array('dimension' => $_SESSION["dimension"], 'day' => $day, 'posx' => $i, 'posy' => $j, 'type' => $simMatrix[$day][$i][$j]['type'], 'lifeforce' => $simMatrix[$day][$i][$j]['life']);
                 }
             }
         }
     } while (count($simulation[$day]) - count(array_keys($simulation[$day], null)) < $_SESSION["dimension"] ** 2);
     return $simMatrix;
 }
開發者ID:liesenborghspuntkristof,項目名稱:Jurassic_Terrarium,代碼行數:44,代碼來源:terrarium_temp.php

示例11: Noidedit

function Noidedit($fd_cat_id, $filename, $display = 0, $picurl = 0, $thumurl = 0)
{
    $db = new DB_test();
    if ($picurl) {
        move($dateid, $scatid);
        //調用回收舊數據函數
        //刪除圖片
        $query = "select *from tb_category_list where fd_cat_dateid='{$dateid}' and fd_cat_scatid='{$scatid}'";
        $db->query($query);
        $db->next_record();
        $url = $db->f(fd_cat_url);
        $thumrul = $db->f(fd_cat_thumurl);
        @unlink($url);
        @unlink($thumrul);
        //更新信息
        $query = "update tb_category_list set fd_cat_name='{$filename}',\n\t\t\tfd_cat_display='{$display}',fd_cat_url='{$picurl}',fd_cat_time=now(),fd_cat_thumurl='{$thumurl}'\n\t\t\twhere fd_cat_id='{$fd_cat_id}'";
    } else {
        $query = "update tb_category_list set fd_cat_name='{$filename}',\n\t\t\tfd_cat_display='{$display}',fd_cat_time=now()\n\t\t\twhere fd_cat_id='{$fd_cat_id}'";
    }
    $db->query($query);
}
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:21,代碼來源:Getimageid.php

示例12: partTwo

function partTwo($input)
{
    $coords = [0, 0];
    $roboCoords = [0, 0];
    $history = [];
    $history[CK] = 0;
    $history = updateHistory($coords, $history);
    $inputArray = str_split($input);
    $santasMove = true;
    foreach ($inputArray as $direction) {
        if ($santasMove) {
            $coords = move($direction, $coords);
            $history = updateHistory($coords, $history);
            $santasMove = false;
        } else {
            $roboCoords = move($direction, $roboCoords);
            $history = updateHistory($roboCoords, $history);
            $santasMove = true;
        }
    }
    return $history[CK];
}
開發者ID:Rory1994,項目名稱:AdventOfCode,代碼行數:22,代碼來源:day3.php

示例13: api_not_allowed

 }
 if (api_is_coach()) {
     if (!DocumentManager::is_visible_by_id($_POST['move_file'], $courseInfo, $sessionId, api_get_user_id())) {
         api_not_allowed(true);
     }
 }
 // Get the document data from the ID
 $document_to_move = DocumentManager::get_document_data_by_id($_POST['move_file'], api_get_course_id(), false, $sessionId);
 // Security fix: make sure they can't move files that are not in the document table
 if (!empty($document_to_move)) {
     $real_path_target = $base_work_dir . $moveTo . '/' . basename($document_to_move['path']);
     $fileExist = false;
     if (file_exists($real_path_target)) {
         $fileExist = true;
     }
     if (move($base_work_dir . $document_to_move['path'], $base_work_dir . $moveTo)) {
         update_db_info('update', $document_to_move['path'], $moveTo . '/' . basename($document_to_move['path']));
         //update database item property
         $doc_id = $_POST['move_file'];
         if (is_dir($real_path_target)) {
             api_item_property_update($courseInfo, TOOL_DOCUMENT, $doc_id, 'FolderMoved', api_get_user_id(), $groupId, null, null, null, $sessionId);
             Display::addFlash(Display::return_message(get_lang('DirMv'), 'confirmation'));
         } elseif (is_file($real_path_target)) {
             api_item_property_update($courseInfo, TOOL_DOCUMENT, $doc_id, 'DocumentMoved', api_get_user_id(), $groupId, null, null, null, $sessionId);
             Display::addFlash(Display::return_message(get_lang('DocMv'), 'confirmation'));
         }
         // Set the current path
         $curdirpath = $_POST['move_to'];
         $curdirpathurl = urlencode($_POST['move_to']);
     } else {
         if ($fileExist) {
開發者ID:omaoibrahim,項目名稱:chamilo-lms,代碼行數:31,代碼來源:document.php

示例14: post

     post($con, $token, $bid, $ip, $attachs);
 } else {
     if ($ask == "reply") {
         reply($con, $token, $bid, $tid, $ip, $attachs);
     } else {
         if ($ask == "edit") {
             edit($con, $token, $bid, $tid, $pid, $ip, $attachs);
         } else {
             if ($ask == "lock" || $ask == "extr" || $ask == "top") {
                 threads_action($con, $token, $bid, $tid, $ask);
             } else {
                 if ($ask == "delete") {
                     delete($con, $token, $bid, $tid, $pid, $ip);
                 } else {
                     if ($ask == "move") {
                         move($con, $token, $bid, $tid, $to);
                     } else {
                         if ($ask == "lzl") {
                             lzl($con, @$_REQUEST['method'], $fid, $token, $ip);
                         } else {
                             if ($ask == "getpages") {
                                 getpages($con, $bid, $tid);
                             } else {
                                 if ($ask == "getlznum") {
                                     getlznum($con, $bid, $tid);
                                 } else {
                                     if ($ask == "getnum") {
                                         getnum($con);
                                     } else {
                                         if ($ask == "sign_today") {
                                             sign_today($con);
開發者ID:hun-tun,項目名稱:CAPUBBS,代碼行數:31,代碼來源:jiekouapi.php

示例15: cr

        cr();
        break;
    case "create":
        create($_REQUEST['nfname'], $_REQUEST['isfolder'], $_REQUEST['ndir']);
        break;
    case "ren":
        ren($_REQUEST['file']);
        break;
    case "rename":
        renam($_REQUEST['rename'], $_REQUEST['nrename'], $folder);
        break;
    case "mov":
        mov($_REQUEST['file']);
        break;
    case "move":
        move($_REQUEST['file'], $_REQUEST['ndir'], $folder);
        break;
    case "printerror":
        printerror($error);
        break;
    case "logout":
        logout();
        break;
    default:
        home();
        break;
}
/****************************************************************/
/* 								MISCELLANEAUS                        */
/*                                                              */
/****************************************************************/
開發者ID:vzool,項目名稱:php_srrFileManager,代碼行數:31,代碼來源:index.php


注:本文中的move函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。