当前位置: 首页>>代码示例>>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;未经允许,请勿转载。