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


PHP count_numeric_items函数代码示例

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


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

示例1: open

	function open($parser, $tag, $attributes){
		$this->data = ''; #stores temporary cdata
		$this->last_opened_tag = $tag;
		if(is_array($this->parent) and array_key_exists($tag,$this->parent)){ #if you've seen this tag before
			if(is_array($this->parent[$tag]) and array_key_exists(0,$this->parent[$tag])){ #if the keys are numeric
				#this is the third or later instance of $tag we've come across
				$key = count_numeric_items($this->parent[$tag]);
			}else{
				#this is the second instance of $tag that we've seen. shift around
				if(array_key_exists("$tag attr",$this->parent)){
					$arr = array('0 attr'=>&$this->parent["$tag attr"], &$this->parent[$tag]);
					unset($this->parent["$tag attr"]);
				}else{
					$arr = array(&$this->parent[$tag]);
				}
				$this->parent[$tag] = &$arr;
				$key = 1;
			}
			$this->parent = &$this->parent[$tag];
		}else{
			$key = $tag;
		}
		if($attributes) $this->parent["$key attr"] = $attributes;
		$this->parent  = &$this->parent[$key];
		$this->stack[] = &$this->parent;
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:26,代码来源:alipay.function.php

示例2: open

 function open(&$parser, $tag, $attributes)
 {
     $this->data = '';
     $this->last_opened_tag = $tag;
     if (is_array($this->parent) and array_key_exists($tag, $this->parent)) {
         if (is_array($this->parent[$tag]) and array_key_exists(0, $this->parent[$tag])) {
             $key = count_numeric_items($this->parent[$tag]);
         } else {
             if (array_key_exists($tag . '_attr', $this->parent)) {
                 $arr = array('0_attr' => &$this->parent[$tag . '_attr'], &$this->parent[$tag]);
                 unset($this->parent[$tag . '_attr']);
             } else {
                 $arr = array(&$this->parent[$tag]);
             }
             $this->parent[$tag] =& $arr;
             $key = 1;
         }
         $this->parent =& $this->parent[$tag];
     } else {
         $key = $tag;
     }
     if ($attributes) {
         $this->parent[$key . '_attr'] = $attributes;
     }
     $this->parent =& $this->parent[$key];
     $this->stack[] =& $this->parent;
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:27,代码来源:xml.class.php

示例3: open

 function open(&$parser, $tag, $attributes)
 {
     $this->data = '';
     #stores temporary cdata
     $this->last_opened_tag = $tag;
     $key = count_numeric_items($this->parent[$tag]);
     if ($attributes) {
         $this->parent[$tag]["{$key} attr"] = $attributes;
     }
     $this->parent[$tag][$key] = array();
     $this->parent =& $this->parent[$tag][$key];
     $this->stack[] =& $this->parent;
 }
开发者ID:CodeMason,项目名称:ancient-monkey-world,代码行数:13,代码来源:xml.php

示例4: open

 function open($parser, $tag, $attributes)
 {
     #echo "Opening tag $tag<br>\n";
     $this->data = "";
     $this->last_opened_tag = $tag;
     #tag is a string
     if (array_key_exists($tag, $this->parent)) {
         #echo "There's already an instance of '$tag' at the current level ($level)<br>\n";
         if (is_array($this->parent[$tag]) and array_key_exists(0, $this->parent[$tag])) {
             #if the keys are numeric
             #need to make sure they're numeric (account for attributes)
             $key = count_numeric_items($this->parent[$tag]);
             #echo "There are $key instances: the keys are numeric.<br>\n";
         } else {
             #echo "There is only one instance. Shifting everything around<br>\n";
             $temp =& $this->parent[$tag];
             unset($this->parent[$tag]);
             $this->parent[$tag][0] =& $temp;
             if (array_key_exists("{$tag} attr", $this->parent)) {
                 #shift the attributes around too if they exist
                 $temp =& $this->parent["{$tag} attr"];
                 unset($this->parent["{$tag} attr"]);
                 $this->parent[$tag]["0 attr"] =& $temp;
             }
             $key = 1;
         }
         $this->parent =& $this->parent[$tag];
     } else {
         $key = $tag;
     }
     if ($attributes) {
         $this->parent["{$key} attr"] = $attributes;
     }
     $this->parent[$key] = array();
     $this->parent =& $this->parent[$key];
     // Changed by Igor Borisov for PHP >= 5.4
     // array_unshift($this->parents, &$this->parent); Original
     array_unshift($this->parents, 0);
     // Changed
     $this->parents[0] =& $this->parent;
     // Added
 }
开发者ID:KravaDima,项目名称:Lesson_JS_new,代码行数:42,代码来源:xmlrpc.php

示例5: open

 function open($parser, $tag, $attributes)
 {
     #echo "Opening tag $tag<br>\n";
     $this->data = "";
     $this->last_opened_tag = $tag;
     #tag is a string
     if (array_key_exists($tag, $this->parent)) {
         #echo "There's already an instance of '$tag' at the current level ($level)<br>\n";
         if (is_array($this->parent[$tag]) and array_key_exists(0, $this->parent[$tag])) {
             #if the keys are numeric
             #need to make sure they're numeric (account for attributes)
             $key = count_numeric_items($this->parent[$tag]);
             #echo "There are $key instances: the keys are numeric.<br>\n";
         } else {
             #echo "There is only one instance. Shifting everything around<br>\n";
             $temp =& $this->parent[$tag];
             unset($this->parent[$tag]);
             $this->parent[$tag][0] =& $temp;
             if (array_key_exists("{$tag} attr", $this->parent)) {
                 #shift the attributes around too if they exist
                 $temp =& $this->parent["{$tag} attr"];
                 unset($this->parent["{$tag} attr"]);
                 $this->parent[$tag]["0 attr"] =& $temp;
             }
             $key = 1;
         }
         $this->parent =& $this->parent[$tag];
     } else {
         $key = $tag;
     }
     if ($attributes) {
         $this->parent["{$key} attr"] = $attributes;
     }
     $this->parent[$key] = array();
     $this->parent =& $this->parent[$key];
     // Can't unshift by reference, so insert dummy and replace it with reference afterwards
     array_unshift($this->parents, NULL);
     $this->parents[0] =& $this->parent;
 }
开发者ID:dcversus,项目名称:keithdevens-xmlrpc,代码行数:39,代码来源:kd_xmlrpc.php


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