• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP next函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: lists

 public function lists()
 {
     if (isset($this->request->params['actor']) == true && isset($this->request->params['genre']) == true) {
         $genre = $this->request->params['genre'];
         $this->set('genre', $genre);
         $array_voiceMenu = $this->setMenu();
         $tmp = $array_voiceMenu;
         //後でforeach構文で最後の処理をするため
         foreach ($array_voiceMenu as $menu) {
             //breadcrumbの設定
             if ($menu['genre'] == $genre) {
                 $this->set('sub_page', $menu['title']);
                 break;
             } elseif (!next($tmp)) {
                 //ジャンルがない場合
                 $this->redirect('/');
             }
         }
         $voice = $this->Voice->find('first', array('conditions' => array('Voice.system_name' => $this->request->params['actor'], 'Voice.publish' => 1)));
         if ($voice) {
             $this->set('voice', $voice);
         } else {
             //公開されたデータがない場合
             $this->redirect('/');
         }
         // 出演作品一覧の取得
         $this->Paginator->settings = array('conditions' => array('Product.voice_id' => $voice['Voice']['id'], 'Product.genre' => $this->request->params['genre'], 'Product.publish' => 1), 'order' => array('Product.date_from' => 'desc'));
         $lists = $this->Paginator->paginate('Product');
         $this->set('lists', $lists);
         $this->render('lists');
     } else {
         $this->redirect('/');
     }
 }
开发者ID:klapp303,项目名称:sister,代码行数:34,代码来源:VoiceController.php


示例17: openDocumentPropeties

function openDocumentPropeties($path, $propertiesSchema = '*')
{
    $client = new \Nuxeo\Automation\Client\NuxeoPhpAutomationClient('http://172.17.42.1:8080/nuxeo/site/automation');
    $session = $client->getSession('Administrator', 'Administrator');
    $answer = $session->newRequest("Document.Query")->set('params', 'query', "SELECT * FROM Document WHERE ecm:path = '" . $path . "'")->setSchema($propertiesSchema)->sendRequest();
    $documentsArray = $answer->getDocumentList();
    $value = sizeof($documentsArray);
    echo '<table>';
    echo '<tr><TH>uid</TH><TH>Path</TH>
		<TH>Type</TH><TH>State</TH><TH>Title</TH><TH>Property 1</TH>
		<TH>Property 2</TH><TH>Download as PDF</TH>';
    for ($test = 0; $test < $value; $test++) {
        echo '<tr>';
        echo '<td> ' . current($documentsArray)->getUid() . '</td>';
        echo '<td> ' . current($documentsArray)->getPath() . '</td>';
        echo '<td> ' . current($documentsArray)->getType() . '</td>';
        echo '<td> ' . current($documentsArray)->getState() . '</td>';
        echo '<td> ' . current($documentsArray)->getTitle() . '</td>';
        echo '<td> ' . current($documentsArray)->getProperty('dc:description') . '</td>';
        echo '<td> ' . current($documentsArray)->getProperty('dc:creator') . '</td>';
        echo '<td><form id="test" action="../samples/B5bis.php" method="post" >';
        echo '<input type="hidden" name="data" value="' . current($documentsArray)->getPath() . '"/>';
        echo '<input type="submit" value="download"/>';
        echo '</form></td></tr>';
        next($documentsArray);
    }
    echo '</table>';
}
开发者ID:gourioua,项目名称:nuxeo-automation-php-client,代码行数:28,代码来源:B1.php


示例18: insertWorkRecord

 /**
  * create
  * @param array $_user_info
  * @param array $_data
  * @return boolean
  */
 public function insertWorkRecord($_user_info, $_data)
 {
     if (!$_user_info || !$_data) {
         return false;
     }
     $adapter = GlobalAdapterFeature::getStaticAdapter();
     $connection = $adapter->getDriver()->getConnection();
     $connection->beginTransaction();
     $work_no = $this->db->getMaxId('work_no') + 1;
     $row = false;
     do {
         $data = array('branch_no' => gv('branch_no', $_user_info), 'login_pw' => make_rand_str(8, 3), 'join_key' => sha1(time() . microtime() . rand(0, 1000)), 'work_no' => $work_no);
         try {
             $this->db->exchanegArray(array_merge(current($_data), $data));
             $row = $this->db->insertRecord(gv('user_no', $_user_info));
         } catch (\Exception $e) {
             if (IS_TEST) {
                 $connection->rollback();
                 echo $e->getMessage();
             }
             break;
         }
     } while (next($_data));
     if ($row) {
         $this->db->checkLoginId($work_no);
         $connection->commit();
     }
     return $row;
 }
开发者ID:jonathan1212,项目名称:zf2,代码行数:35,代码来源:WorkUserEntity.php


示例19: _get_prev_item

	function _get_prev_item(&$items, $current_id)
	{
		reset($items);
		$prev = array();
		
		foreach(array_keys($items) as $id)
			if ($current_id == $items[$id]['id'])
			{
				break;
			}	
			else
			{
				next($items);
			}
		
		if (($item = prev($items)) !== false)
			return $item;
		else
			return array();
		
		if (!$prev)
			return array();
		if($prev['id'] == $current_id)
			return array();
		return $prev;		
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:26,代码来源:presentation_datasource.class.php


示例20: applyFunctorToCartesianProduct

 public static function applyFunctorToCartesianProduct($arrays, TupleFunctor $functor)
 {
     $result = [];
     $size = sizeof($arrays) > 0 ? 1 : 0;
     foreach ($arrays as $array) {
         $size *= sizeof($array);
     }
     $keys = array_keys($arrays);
     foreach ($keys as $key) {
         $tmpArrays[] = $arrays[$key];
     }
     for ($i = 0; $i < $size; $i++) {
         $result[$i] = [];
         for ($j = 0; $j < sizeof($tmpArrays); $j++) {
             $result[$i][$keys[$j]] = current($tmpArrays[$j]);
         }
         $functor->apply($result[$i]);
         unset($result[$i]);
         for ($j = sizeof($tmpArrays) - 1; $j >= 0; $j--) {
             if (next($tmpArrays[$j])) {
                 break;
             } else {
                 reset($tmpArrays[$j]);
             }
         }
     }
 }
开发者ID:justthefish,项目名称:hesper,代码行数:27,代码来源:MathUtils.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP nextAccessToken函数代码示例发布时间:2022-05-15
下一篇:
PHP newv函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap