当前位置: 首页>>代码示例>>PHP>>正文


PHP index函数代码示例

本文整理汇总了PHP中index函数的典型用法代码示例。如果您正苦于以下问题:PHP index函数的具体用法?PHP index怎么用?PHP index使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了index函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: nav

function nav()
{
    unset($_SESSION['index_class']);
    unset($_SESSION['editmix_class']);
    unset($_SESSION['validate_class']);
    unset($_SESSION['makemix_class']);
    unset($_SESSION['mwbedocs_class']);
    unset($_SESSION['upfiles_class']);
    if ($_SESSION['action'] == "index") {
        index();
    } elseif ($_SESSION['action'] == "makemix") {
        makemix();
    } elseif ($_SESSION['action'] == "upfiles") {
        upfiles();
    } elseif ($_SESSION['action'] == "verify") {
        verify();
    } elseif ($_SESSION['action'] == "validate") {
        validate();
    } elseif ($_SESSION['action'] == "editmix") {
        editmix();
    } elseif ($_SESSION['action'] == "mwbedocs") {
        mwbedocs();
    } elseif ($_SESSION['action'] == "delmix") {
        delmix();
    } else {
        index();
    }
}
开发者ID:romeosidvicious,项目名称:MixWidget-Back-End,代码行数:28,代码来源:functions.php

示例2: checkEntityFieldIntegrity

 public function checkEntityFieldIntegrity($entityName, $entityFieldName, $testValue)
 {
     $castFunction = $this->model[$entityName]["definition"][$entityFieldName]["cast"];
     $check = $this->model[$entityName]["definition"][$entityFieldName]["check"]($testValue, $castFunction);
     if ($entityFieldName == "user_id") {
         index($this->model[$entityName]["definition"]);
     }
     return $check;
 }
开发者ID:benjaminchazelle,项目名称:StarWarsMarket,代码行数:9,代码来源:datamodel.class.php

示例3: connexion

function connexion()
{
    if (!User::isConnected()) {
        include VIEW . "connexion.php";
        if (isset($_POST['login'])) {
            echo "<p id='mErreur'>Mot de passe ou login erroné</p>";
        }
    } else {
        index();
    }
}
开发者ID:fauvet,项目名称:GESCABMED,代码行数:11,代码来源:accueil.php

示例4: show

 public function show($id = null)
 {
     if (is_null($id)) {
         return index();
     } else {
         $tags = User::find(Auth::user()->id)->tags()->where('tags.id', '=', $id)->first();
         if (is_null($tags)) {
             return PaperworkHelpers::apiResponse(PaperworkHelpers::STATUS_NOTFOUND, array());
         } else {
             return PaperworkHelpers::apiResponse(PaperworkHelpers::STATUS_SUCCESS, $tags);
         }
     }
 }
开发者ID:netesheng,项目名称:paperwork,代码行数:13,代码来源:ApiTagsController.php

示例5: handle

function handle()
{
    header('Content-Type: text/html');
    $base = urldecode($_SERVER['REQUEST_URI']);
    if ($base == '/Biblisches/Grundtext/') {
        index();
        return;
    }
    if (preg_match('/([^-]+)-(\\d+)/', $_GET['v'], $matched)) {
        chapter($matched[1], $matched[2]);
        return;
    }
    print "404. " . link_kapitel_auswahl();
}
开发者ID:ReneNyffenegger,项目名称:Bible-Text-Sources,代码行数:14,代码来源:handler.php

示例6: show

 public function show($id = null)
 {
     if (is_null($id)) {
         return index();
     } else {
         $shortcuts = DB::table('notebooks')->join('shortcuts', function ($join) {
             $join->on('notebooks.id', '=', 'shortcuts.notebook_id')->where('shortcuts.user_id', '=', Auth::user()->id);
         })->select('notebooks.id', 'notebooks.parent_id', 'notebooks.type', 'notebooks.title', 'shortcuts.id', 'shortcuts.sortkey')->where('notebooks.id', '=', $id)->first();
         if (is_null($shortcuts)) {
             return PaperworkHelpers::apiResponse(PaperworkHelpers::STATUS_NOTFOUND, array());
         } else {
             return PaperworkHelpers::apiResponse(PaperworkHelpers::STATUS_SUCCESS, $shortcuts);
         }
     }
 }
开发者ID:Liongold,项目名称:paperwork,代码行数:15,代码来源:ApiShortcutsController.php

示例7: init

function init($conexao)
{
    if (isset($_POST['acao'])) {
        switch ($_POST['acao']) {
            case 'add':
                adicionar($conexao);
                break;
            case 'edit':
                editar($conexao);
                break;
            case 'delete':
                remover($conexao);
                break;
        }
    } else {
        index($conexao);
    }
}
开发者ID:ram0nc,项目名称:dead,代码行数:18,代码来源:curso-controller.php

示例8: do_upload

function do_upload()
{
    include "classes/Upload.php";
    $config['upload_path'] = './uploads/';
    // $config['allowed_types'] = '';
    $config['max_size'] = '100';
    $UpFile = new Upload($config);
    if (!$UpFile->do_upload()) {
        echo "<span style='color:#ff0000;'>Se ha producido un error</span>";
        index();
    } else {
        $dataFile = $UpFile->data();
        $file = 'uploads/' . $dataFile['file_name'];
        $pass = $_POST['pass'];
        //$output = system('./revtrans.php --password='.$pass.' '.$file);
        //printf("System Outputs: $output\n");
        exec('./revtrans.php --password=' . $pass . ' ' . $file, $results);
        //parser mejorable pero bueno
        $results = implode($results);
        $results = str_replace('""', '#', $results);
        $results = str_replace(',', '#', $results);
        $results = str_replace('"', '', $results);
        $results = preg_split("/#/", $results);
        $i = 0;
        $aux = 0;
        $Keys = array();
        foreach ($results as $result) {
            $Keys[$aux][] = $result;
            $i++;
            if ($i == 5) {
                $i = 0;
                $aux++;
            }
        }
        //print_r($Keys);
        $i = 0;
        foreach ($Keys as $Key) {
            if ($i != 0) {
                echo $Key[0] . "=>" . $Key[2] . "<br>";
            }
            $i++;
        }
    }
}
开发者ID:robertorubioes,项目名称:WebRPM,代码行数:44,代码来源:index.php

示例9: popup_switch

function popup_switch()
{
    switch ($_GET["main"]) {
        case "index":
            echo index();
            break;
        case "system":
            echo section_system();
            break;
        case "mail":
            echo section_messaging();
            break;
        case "proxy":
            echo section_proxy();
            break;
        default:
            break;
    }
}
开发者ID:brucewu16899,项目名称:artica,代码行数:19,代码来源:statistics.index.php

示例10: rebuildThemes

         rebuildThemes('boards');
         header('Location: ?/' . $b['uri'] . '/' . $config['file_index'], true, $config['redirect_http']);
     } else {
         $body .= form_newBoard();
         // TODO: Statistics, etc, in the dashboard.
         echo Element('page.html', array('config' => $config, 'title' => 'New board', 'body' => $body, 'mod' => true));
     }
 } elseif (preg_match('/^\\/' . $regex['board'] . '(' . $regex['index'] . '|' . $regex['page'] . ')?$/', $query, $matches)) {
     // Board index
     $boardName =& $matches[1];
     // Open board
     if (!openBoard($boardName)) {
         error($config['error']['noboard']);
     }
     $page_no = empty($matches[2]) || $matches[2] == $config['file_index'] ? 1 : $matches[2];
     if (!($page = index($page_no, $mod))) {
         error($config['error']['404']);
     }
     $page['pages'] = getPages(true);
     $page['pages'][$page_no - 1]['selected'] = true;
     $page['btn'] = getPageButtons($page['pages'], true);
     $page['mod'] = true;
     echo Element('index.html', $page);
 } elseif (preg_match('/^\\/' . $regex['board'] . $regex['res'] . $regex['page'] . '$/', $query, $matches)) {
     // View thread
     $boardName =& $matches[1];
     $thread =& $matches[2];
     // Open board
     if (!openBoard($boardName)) {
         error($config['error']['noboard']);
     }
开发者ID:niksfish,项目名称:Tinyboard,代码行数:31,代码来源:mod.php

示例11: usersMenus

	include_once('ressources/class.templates.inc');
	include_once('ressources/class.users.menus.inc');
	include_once('ressources/class.maincf.multi.inc');
	
	
$users=new usersMenus();
if(!$users->AsPostfixAdministrator){
	$tpl=new templates();
	$ERROR_NO_PRIVS=$tpl->javascript_parse_text("{ERROR_NO_PRIVS}");
	echo "alert('$ERROR_NO_PRIVS');";
	die();
	
}

	if(isset($_GET["popup"])){popup();exit;}
	if(isset($_GET["index"])){index();exit;}
	if(isset($_GET["settings"])){parameters();exit;}
	if(isset($_GET["dnsbl"])){dnsbl();exit;}
	if(isset($_GET["dnsbl-list"])){dnsbl_list();exit;}
	if(isset($_GET["dnsbl-add"])){dnsbl_add();exit;}
	if(isset($_GET["dnsbl-delete"])){dnsbl_delete();exit;}
	if(isset($_GET["postscreen_dnsbl_action"])){saveConfig();exit;}
	if(isset($_GET["postscreen_bare_newline_enable"])){saveConfig();exit;}
	
	
	
	if(isset($_GET["EnablePostScreen"])){EnablePostScreen_edit();exit;}

js();

开发者ID:rsd,项目名称:artica-1.5,代码行数:29,代码来源:postscreen.php

示例12: fwrite

     {
     echo 'Successfully created<br />'."\n";
     echo 'Go to BBS: <a href="../'.$_POST['bbs'].'/index.html">'.$_POST['title'].'</a><br />'."\n";
     if(!file_exists('../'.$_POST['bbs'].'/')) mkdir('../'.$_POST['bbs'].'/',0777);
     if(!file_exists('../'.$_POST['bbs'].'/.htaccess'))
      {
      $fp=fopen('../'.$_POST['bbs'].'/.htaccess','w');
      fwrite($fp,'DirectoryIndex index.html');
      fclose($fp);
      }
     require 'page_elements.php';
     $fp=fopen("../".$_POST['bbs']."/index.html",'w');
     fwrite($fp,head($bbs_name,$_POST['title']));
     fwrite($fp,index_display($bbs_name,$_POST['title'],$bbs['display']));
     fwrite($fp,index_menu($_POST['bbs'],$db_prefix,$menu_n,$index_n));
     fwrite($fp,index($_POST['bbs'],$db_prefix,$index_posts_n,$index_n,$_POST['postname'],$_POST['show_id']));
     fwrite($fp,form($_POST['bbs']));
     fwrite($fp,$foot);
     fclose($fp);

     $fp=fopen("../".$_POST['bbs']."/subback.html",'w');
     fwrite($fp,$head);
     fwrite($fp,index_menu($_POST['bbs'],$db_prefix));
     fwrite($fp,$foot);
     fclose($fp);
     }
    }
   ?>
Create BBS:
<form action="?operate=bbs&action=create" method="post">
<table style="margin-left: auto; margin-right: auto; text-align: left;" border="1">
开发者ID:princessGasmask,项目名称:lucidtea,代码行数:31,代码来源:operate.php

示例13: buildIndex

function buildIndex($global_api = "yes")
{
    global $board, $config, $build_pages;
    if (!$config['smart_build']) {
        $pages = getPages();
        if (!$config['try_smarter']) {
            $antibot = create_antibot($board['uri']);
        }
        if ($config['api']['enabled']) {
            $api = new Api();
            $catalog = array();
        }
    }
    for ($page = 1; $page <= $config['max_pages']; $page++) {
        $filename = $board['dir'] . ($page == 1 ? $config['file_index'] : sprintf($config['file_page'], $page));
        $jsonFilename = $board['dir'] . ($page - 1) . '.json';
        // pages should start from 0
        if ((!$config['api']['enabled'] || $global_api == "skip" || $config['smart_build']) && $config['try_smarter'] && isset($build_pages) && !empty($build_pages) && !in_array($page, $build_pages)) {
            continue;
        }
        if (!$config['smart_build']) {
            $content = index($page);
            if (!$content) {
                break;
            }
            // json api
            if ($config['api']['enabled']) {
                $threads = $content['threads'];
                $json = json_encode($api->translatePage($threads));
                file_write($jsonFilename, $json);
                $catalog[$page - 1] = $threads;
            }
            if ($config['api']['enabled'] && $global_api != "skip" && $config['try_smarter'] && isset($build_pages) && !empty($build_pages) && !in_array($page, $build_pages)) {
                continue;
            }
            if ($config['try_smarter']) {
                $antibot = create_antibot($board['uri'], 0 - $page);
                $content['current_page'] = $page;
            }
            $antibot->reset();
            $content['pages'] = $pages;
            $content['pages'][$page - 1]['selected'] = true;
            $content['btn'] = getPageButtons($content['pages']);
            $content['antibot'] = $antibot;
            file_write($filename, Element('index.html', $content));
        } else {
            file_unlink($filename);
            file_unlink($jsonFilename);
        }
    }
    if (!$config['smart_build'] && $page < $config['max_pages']) {
        for (; $page <= $config['max_pages']; $page++) {
            $filename = $board['dir'] . ($page == 1 ? $config['file_index'] : sprintf($config['file_page'], $page));
            file_unlink($filename);
            if ($config['api']['enabled']) {
                $jsonFilename = $board['dir'] . ($page - 1) . '.json';
                file_unlink($jsonFilename);
            }
        }
    }
    // json api catalog
    if ($config['api']['enabled'] && $global_api != "skip") {
        if ($config['smart_build']) {
            $jsonFilename = $board['dir'] . 'catalog.json';
            file_unlink($jsonFilename);
            $jsonFilename = $board['dir'] . 'threads.json';
            file_unlink($jsonFilename);
        } else {
            $json = json_encode($api->translateCatalog($catalog));
            $jsonFilename = $board['dir'] . 'catalog.json';
            file_write($jsonFilename, $json);
            $json = json_encode($api->translateCatalog($catalog, true));
            $jsonFilename = $board['dir'] . 'threads.json';
            file_write($jsonFilename, $json);
        }
    }
    if ($config['try_smarter']) {
        $build_pages = array();
    }
}
开发者ID:Cipherwraith,项目名称:infinity,代码行数:80,代码来源:functions.php

示例14: split

<?php

require_once "modules/index.php";
require_once "modules/game.php";
$query = $_SERVER['QUERY_STRING'];
$query = split("/", $query);
$module = array_shift($query);
$parameters = $query;
switch ($module) {
    case "g":
        //game
        game($parameters);
        break;
    case "help":
        //help functions
        break;
    default:
        index($parameters);
}
开发者ID:heikkiket,项目名称:konquest-html5,代码行数:19,代码来源:index.php

示例15: main_switch

function main_switch()
{
    switch ($_GET["main"]) {
        case "index":
            index();
            exit;
            break;
        case "artica_process":
            main_config();
            exit;
            break;
        default:
            break;
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:15,代码来源:artica.performances.php


注:本文中的index函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。