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


PHP next函数代码示例

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


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

示例1: prepare_form

 /**
  * {@inheritdoc}
  */
 public function prepare_form($request, $template, $user, $row, &$error)
 {
     $avatar_list = $this->get_avatar_list($user);
     $category = $request->variable('avatar_local_cat', key($avatar_list));
     foreach ($avatar_list as $cat => $null) {
         if (!empty($avatar_list[$cat])) {
             $template->assign_block_vars('avatar_local_cats', array('NAME' => $cat, 'SELECTED' => $cat == $category));
         }
         if ($cat != $category) {
             unset($avatar_list[$cat]);
         }
     }
     if (!empty($avatar_list[$category])) {
         $template->assign_vars(array('AVATAR_LOCAL_SHOW' => true));
         $table_cols = isset($row['avatar_gallery_cols']) ? $row['avatar_gallery_cols'] : 4;
         $row_count = $col_count = $avatar_pos = 0;
         $avatar_count = sizeof($avatar_list[$category]);
         reset($avatar_list[$category]);
         while ($avatar_pos < $avatar_count) {
             $img = current($avatar_list[$category]);
             next($avatar_list[$category]);
             if ($col_count == 0) {
                 ++$row_count;
                 $template->assign_block_vars('avatar_local_row', array());
             }
             $template->assign_block_vars('avatar_local_row.avatar_local_col', array('AVATAR_IMAGE' => $this->phpbb_root_path . $this->config['avatar_gallery_path'] . '/' . $img['file'], 'AVATAR_NAME' => $img['name'], 'AVATAR_FILE' => $img['filename'], 'CHECKED' => $img['file'] === $row['avatar']));
             $template->assign_block_vars('avatar_local_row.avatar_local_option', array('AVATAR_FILE' => $img['filename'], 'S_OPTIONS_AVATAR' => $img['filename'], 'CHECKED' => $img['file'] === $row['avatar']));
             $col_count = ($col_count + 1) % $table_cols;
             ++$avatar_pos;
         }
     }
     return true;
 }
开发者ID:WarriorMachines,项目名称:warriormachines-phpbb,代码行数:36,代码来源:local.php

示例2: preWrite

 /**
  * @param cfhCompile_CodeWriter $codeWriter
  * @param cfhCompile_Class_Interface $class
  * @param unknown_type $sourceCode
  * @param cfhCompile_ClassRegistry $classRegistry
  * @return String
  */
 public function preWrite(cfhCompile_CodeWriter $codeWriter, cfhCompile_Class_Interface $class, $sourceCode, cfhCompile_ClassRegistry $classRegistry)
 {
     if (is_null($sourceCode)) {
         return NULL;
     }
     $tokens = token_get_all('<?php ' . $sourceCode);
     $sourceCode = '';
     $lastWasString = FALSE;
     while ($token = current($tokens)) {
         $nextIsString = is_string(next($tokens));
         prev($tokens);
         if (is_string($token)) {
             $sourceCode .= $token;
             $lastWasString = TRUE;
         } else {
             list($token, $text) = $token;
             if ($token == T_WHITESPACE) {
                 if ($lastWasString === FALSE && $nextIsString === FALSE) {
                     $sourceCode .= ' ';
                 }
             } else {
                 $sourceCode .= $text;
             }
             $lastWasString = FALSE;
         }
         next($tokens);
     }
     return trim(substr($sourceCode, 5));
 }
开发者ID:googlecode-mirror,项目名称:cfh-compile,代码行数:36,代码来源:StripWhiteSpace.php

示例3: loadData

 /**
  * Load the data
  */
 private function loadData()
 {
     // get the current page id
     $pageId = $this->getContainer()->get('page')->getId();
     $navigation = FrontendNavigation::getNavigation();
     $pageInfo = FrontendNavigation::getPageInfo($pageId);
     $this->navigation = array();
     if (isset($navigation['page'][$pageInfo['parent_id']])) {
         $pages = $navigation['page'][$pageInfo['parent_id']];
         // store
         $pagesPrev = $pages;
         $pagesNext = $pages;
         // check for current id
         foreach ($pagesNext as $key => $value) {
             if ((int) $key != (int) $pageId) {
                 // go to next pointer in array
                 next($pagesNext);
                 next($pagesPrev);
             } else {
                 break;
             }
         }
         // get previous page
         $this->navigation['previous'] = prev($pagesPrev);
         // get next page
         $this->navigation['next'] = next($pagesNext);
         // get parent page
         $this->navigation['parent'] = FrontendNavigation::getPageInfo($pageInfo['parent_id']);
     }
 }
开发者ID:bwgraves,项目名称:forkcms,代码行数:33,代码来源:PreviousNextNavigation.php

示例4: isValid

 public function isValid($sValue)
 {
     $this->_setValue($sValue);
     if (null === self::$_filter) {
         require_once 'Zend/Filter/Digits.php';
         self::$_filter = new Zend_Filter_Digits();
     }
     $sValueFiltered = self::$_filter->filter($sValue);
     $nLength = strlen($sValueFiltered);
     if ($nLength != 10) {
         $this->_error(self::LENGTH);
         return false;
     }
     $nMod = 11;
     $nSum = 0;
     $aWeights = array(6, 5, 7, 2, 3, 4, 5, 6, 7);
     preg_match_all("/\\d/", $sValueFiltered, $aDigits);
     $aValueFiltered = $aDigits[0];
     foreach ($aValueFiltered as $nDigit) {
         $nWeight = current($aWeights);
         $nSum += $nDigit * $nWeight;
         next($aWeights);
     }
     if (($nSum % $nMod == 10 ? 0 : $nSum % $nMod) != $aValueFiltered[$nLength - 1]) {
         $this->_error(self::CHECKSUM, $sValueFiltered);
         return false;
     }
     return true;
 }
开发者ID:lstaszak,项目名称:zf_zk_aleph,代码行数:29,代码来源:Nip.php

示例5: _get_select

 function _get_select()
 {
     $exclude = array();
     $wlk = $this->_tree_walk_preorder($this->node);
     while (!$wlk['recset']->EOF) {
         $row = $wlk['recset']->fields;
         $exclude[$row['id']] = 'yes';
         $wlk['recset']->MoveNext();
     }
     $mySelect = new CHAW_select($this->key);
     $node = $this->_tree_get_group_root_node($this->usergroup);
     $attributes = array('name');
     $wlk = $this->_tree_walk_preorder($node);
     while ($curr = $this->_tree_walk_next($wlk)) {
         $level = $this->_tree_walk_level($wlk);
         $spaces = str_repeat('--', $level - 1);
         $att = reset($attributes);
         while ($att) {
             if ($level == 0) {
                 $mySelect->add_option('(seleziona cartella)', $wlk['row']['id']);
             } elseif ($wlk['row']['file'] == '' && !isset($exclude[$wlk['row']['id']])) {
                 $mySelect->add_option($spaces . $wlk['row'][$att], $wlk['row']['id']);
             }
             $att = next($attributes);
         }
     }
     return $mySelect;
 }
开发者ID:umbecr,项目名称:camilaframework,代码行数:28,代码来源:fm_exclude_current_dir_listbox.php

示例6: event_save_meta

 public static function event_save_meta($result, $EM_Event)
 {
     if ($result && EM_ML::is_original($EM_Event)) {
         //save post meta for all others as well
         foreach (EM_ML::get_langs() as $lang_code => $language) {
             $event = EM_ML::get_translation($EM_Event, $lang_code);
             /* @var $EM_Event EM_Event */
             if ($event->event_id != $EM_Event->event_id) {
                 self::event_merge_original_meta($event, $EM_Event);
                 //if we execute a meta save here, we will screw up the current em_event_save_meta $wp_filter pointer executed in do_action()
                 //therefore, we save the current pointer position (priority) and set it back after saving the location further down
                 global $wp_filter, $wp_current_filter;
                 $wp_filter_priority = key($wp_filter['em_event_save_meta']);
                 $tag = end($wp_current_filter);
                 //save the event meta
                 $event->save_meta();
                 //reset save_post pointer in $wp_filter to its original position
                 reset($wp_filter[$tag]);
                 do {
                     if (key($wp_filter[$tag]) == $wp_filter_priority) {
                         break;
                     }
                 } while (next($wp_filter[$tag]) !== false);
             }
         }
     }
     return $result;
 }
开发者ID:mjrobison,项目名称:FirstCareCPR,代码行数:28,代码来源:em-ml-io.php

示例7: generateJSON

function generateJSON($auth_key, $guid, $year, $filename)
{
    // Get json from API
    $url = "http://api.quito.junar.com/datastreams/invoke/" . $guid . "?auth_key=" . $auth_key . "&output=json_array";
    $str = file_get_contents($url);
    $json = json_decode($str, true);
    // Array of Zonales id
    $zonales_id = array(1 => "Calderón", 2 => "Eloy Alfaro", 3 => "Eugenio Espejo", 4 => "La Delicia", 5 => "Los Chillos", 6 => "Manuela Saenz", 7 => "Quitumbe", 8 => "Tumbaco", 12 => "Sur", 13 => "Norte", 16 => "Centro");
    $datos = array();
    // Reading JSON and verify
    foreach ($json['result'] as $data) {
        $id_zonal = 0;
        $zonal = reset($zonales_id);
        // Checks if json contains a valid zonal and returns id
        while ($zonal = current($zonales_id)) {
            if (strpos($zonal, $data[1]) !== false) {
                $id_zonal = key($zonales_id);
                break;
            }
            next($zonales_id);
        }
        // Assings data according to id
        if ($id_zonal > 0) {
            if ($id_zonal > 10) {
                $id_zonal = $id_zonal - 10;
            }
            $datos[] = array("id" => $id_zonal, "zonal" => html_entity_decode($zonales_id[$id_zonal]), "periodo" => 2014, "dato" => intval($data[14]));
        }
    }
    // Write json
    file_put_contents($filename, json_encode($datos));
}
开发者ID:flandrade,项目名称:quito-crime-map,代码行数:32,代码来源:getdata.php

示例8: fromStringWithMessage

 public function fromStringWithMessage($string, $message, $messagePrefix = '# ', $extension = null)
 {
     if (null !== $message) {
         $message = explode("\n", $message);
         foreach ($message as $line) {
             $source[] = $messagePrefix . $line;
         }
         $source = implode("\n", $source) . PHP_EOL;
     } else {
         $source = '';
     }
     $source .= $string;
     $res = $this->fromString($source, $extension);
     $res = explode("\n", $res);
     $line = current($res);
     while (0 === strpos($line, $messagePrefix)) {
         $line = next($res);
     }
     $out = [];
     while ($line) {
         $out[] = $line;
         $line = next($res);
     }
     return implode("\n", $out);
 }
开发者ID:phpcr,项目名称:phpcr-shell,代码行数:25,代码来源:EditorHelper.php

示例9: getNewsCommonLink

 /**
  * 连表查询 公共方法
  * @param string $files 查询字段
  * @param array $manTable 主表 array('表名'=>'别名')
  * @param array $link 关联表 array('$_link'=>'别名')
  * @param string $where 查询条件
  * @param string $order 排序
  * @param string $limit limit
  * @param int $type 1:返回一条一维数据 0:默认返回二维数组
  * @return array
  */
 public function getNewsCommonLink($files = '*', $manTable, $link, $where = '', $order = '', $limit = '', $type = 0)
 {
     $manTableName = key($manTable);
     $manTableAlse = $manTable[$manTableName];
     $sql = "SELECT " . $files;
     $sql .= " FROM " . $manTableName . " AS " . $manTableAlse;
     if ($link) {
         while ($key = key($link)) {
             $sql .= " LEFT JOIN " . $this->_link[$key]['table'] . " AS " . $link[$key] . " ON " . $link[$key] . "." . $this->_link[$key]['otherKey'] . " = " . $manTableAlse . "." . $this->_link[$key]['selfKey'];
             next($link);
         }
     }
     if ($where) {
         $sql .= " WHERE " . $where;
     }
     if ($order) {
         $sql .= " ORDER BY " . $order;
     }
     if ($limit) {
         $sql .= " LIMIT " . $limit;
     }
     $query = $this->db->query($sql);
     if ($query->num_rows > 0) {
         if (!$type) {
             return $query->result_array();
         } else {
             return $query->row_array();
         }
     } else {
         return array();
     }
 }
开发者ID:804485808,项目名称:teaseb.com,代码行数:43,代码来源:news_review_model.php

示例10: mergeCodeCoverage

 private static function mergeCodeCoverage($left, $right)
 {
     $coverageMerged = array();
     reset($left);
     reset($right);
     while (current($left) && current($right)) {
         $linenr_left = key($left);
         $linenr_right = key($right);
         if ($linenr_left < $linenr_right) {
             $coverageMerged[$linenr_left] = current($left);
             next($left);
         } elseif ($linenr_right < $linenr_left) {
             $coverageMerged[$linenr_right] = current($right);
             next($right);
         } else {
             if (current($left) < 0 || current($right) < 0) {
                 $coverageMerged[$linenr_right] = current($right);
             } else {
                 $coverageMerged[$linenr_right] = current($left) + current($right);
             }
             next($left);
             next($right);
         }
     }
     while (current($left)) {
         $coverageMerged[key($left)] = current($left);
         next($left);
     }
     while (current($right)) {
         $coverageMerged[key($right)] = current($right);
         next($right);
     }
     return $coverageMerged;
 }
开发者ID:philippjenni,项目名称:icinga-web,代码行数:34,代码来源:CoverageMerger.php

示例11: next

 public function next()
 {
     $isValid = next($this->_collectionItems);
     if (false == $isValid) {
         $this->_valid = false;
     }
 }
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:7,代码来源:class.ffAttachmentCollection.php

示例12: next

 public function next()
 {
     $hasNext = next($this->_taxonomiesFromWp);
     if (false == $hasNext) {
         $this->_hasNext = false;
     }
 }
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:7,代码来源:class.ffCustomTaxonomyCollection.php

示例13: advanceElementIterator

 private function advanceElementIterator(\Iterator $element)
 {
     $element->next();
     if (!$element->valid()) {
         next($this->fields);
     }
 }
开发者ID:PeeHaa,项目名称:Artax,代码行数:7,代码来源:MultipartIterator.php

示例14: SaveArray

function SaveArray($vArray)
{
    global $buffer;
    // Every array starts with chr(1)+"{"
    $buffer .= "{";
    // Go through the given array
    reset($vArray);
    while (true) {
        $Current = current($vArray);
        $MyKey = addslashes(strval(key($vArray)));
        if (is_array($Current)) {
            $buffer .= $MyKey . "";
            SaveArray($Current);
            $buffer .= "";
        } else {
            $Current = addslashes($Current);
            $buffer .= "{$MyKey}{$Current}";
        }
        ++$i;
        while (next($vArray) === false) {
            if (++$i > count($vArray)) {
                break;
            }
        }
        if ($i > count($vArray)) {
            break;
        }
    }
    $buffer .= "}";
}
开发者ID:xenda,项目名称:camaraitalia,代码行数:30,代码来源:lib_functions.php

示例15: insertLineComments

 static function insertLineComments($scss, $filepath = '')
 {
     $lines = $scss;
     $new_scss_content = array();
     $filepath = str_replace('\\', '/', $filepath);
     foreach ($lines as $linenumber => $line) {
         $line = trim($line);
         $nextline = trim(next($lines));
         //check if empty
         if (empty($line)) {
             continue;
         }
         //check if line is a commment
         if (self::isComment($line) || self::$inside_multiline) {
             $new_scss_content[] = $line;
             continue;
         }
         //write line numbers for selectors only to reduce overhead
         if (self::isSelector($line, $nextline) == FALSE || self::isFunction($line) == TRUE || self::isMixin($line) == TRUE || self::isInclude($line) == TRUE || self::isCondition($line) == TRUE || self::isLoop($line) == TRUE || self::isMap($line) == TRUE) {
             $new_scss_content[] = $line;
             continue;
         }
         //output line commment
         $new_scss_content[] = self::comment_indicator_start . ' line ' . ($linenumber + 1) . ', ' . $filepath . ' ' . self::comment_indicator_end;
         $new_scss_content[] = $line;
     }
     return implode("\n", $new_scss_content);
 }
开发者ID:CamilleBouliere,项目名称:SASS-PHP---Out-of-the-box,代码行数:28,代码来源:LineCommentator.php


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