一、数组添加元素

1、定义和用法:

array_push() 函数向第一个参数的数组尾部添加一个或多个元素(入栈),然后返回新数组的长度。

2、语法:

array_push(array,value1,value2...)

array指数组,value指添加的值

3、举例:

<?php

$a=array("red","green");

array_push($a,"blue","yellow");

print_r($a); ?>

输出结果:Array ( [0] => red [1] => green [2] => blue [3] => yellow )

二、统计数组相同元素个数

1、定义和用法:

array_count_values()返回一个数组,该数组用数组中的值作为键名,该键值是在数组中出现的次数。

2、语法:

array_count_values(array)

array指数组

3、举例:

<?php
     $array = array(1, "hello", 1, "world", "hello");
     print_r(array_count_values($array));?>

输出结果:Array( [1] => 2  [hello] => 2  [world] => 1)

三、改变数组key值

1、举例:

数组$datas的形式如下:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAwoAAABjCAIAAAC0SWB5AAAYiElEQVR4nO2du7mzvBKF6YIyHLgIV0HiHlwECSXsAk5EQnayr4CT7IQO6EInwBYjaWaQAIvLXu+zg//nk4U0GkkLXYv//Pd/+MMf/vCHP/zhD3/4s3+FAQAAAAAABMgjAAAAAAAHyCMAAAAAAAfIIwAAAAAAB8gjAAAAAAAHyCMAAAAAAAfIIwAAAAAAB8gjAAAAAAAHyCMAAAAAAAfIIwAAAAAAhxPLo6Z6dL/DXKjheSuLoiiKorw91dD9vSjiQoIrs7VfbQX88wjkL/ejAT88AtfzwyP61VnlUVc/m7aPCDjU9U9q5D91fZDiiWBJBvemb6PKbge+6ldbcSr//AY7+s+hqtsaO2yQEfgh/DDgUn41K4+G56181l2OtEQz/HaPqokMy5ZWVz9HocpmbV3xDM/bI0+lGXNxJ6bo26aYuPckmJTZDCmkiRyfzEmQ/j4fZnvW+1UezuKf3yDOf76HWO7Db1d+vn7p6GNXP5O+hiPDr7EDaTemQYiCS7wO/PCAfhiSrf2/nl/NyqP+VVXRfUYehuftFm1rxo36tvlIB74bXq1e+/tHmnybvm2s8iD5GtPgN9OZ5RFt6Jvqbt/eVPdDyqO1fpWNE/nnN4jwn+8hlftU3air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tzKkZx962mFQcvVfjkHd7/uc0VXPy+d/O18ASNaX55AAAAASRIYEAABgI0MCAACwkSEBAADYyJAAAABsZEgAAAA2MiQAAAAbGRIAAICNDAkAAMBGhgQAAGAjQwIAALCRIQEAANjIkAAAAGxkSAAAADYyJAAAABsZEgAAgI0MCQAAwEaGBAAAYCNDAgAAsJEhAQAA2P4Ben/wmZCtbq0AAAAASUVORK5CYII=" alt="" />

将数组$ary2的key值赋给数组$datas的key值,代码如下:

foreach ($datas as $key => $value){
            $keys = $value->name; //取出要作为key的字段
            $datas[$value->name] = $value; //赋值
            unset($datas[$key]);//释放原来的key
      }

print_r($datas);exit;

输出结果:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAwkAAABcCAIAAACqUm4CAAAY3UlEQVR4nO2dzaGrIBCF7cIyskgRqcJNekgRbizh1pCNFbwWsrEDu+AtTHCAmRHU4E/Ot3rPaxCGwzACQmEAAAAAAMCHYusMAAAAAADsCMRGAAAAAAAjiI0AAAAAAEYQGwEAAAAAjCA2AgAAAAAYQWwEAAAAADCC2AgAAAAAYOSosVFT3dpXP3VXf7+URVEURVFe7pN3n5HuWhS/bQFgzH7bC/S5B+AnoUPgc8jYqK3vzbOLuLGv67+v52Yp3TOqLEv5q+vjtPlDVJxHpnqcwSHay6H0+Q021M+umtsSO6xQEOhwt34sM3ps1N8v5b1uM+Uljv7V3qom8t49tXmGtr4XRRHXby1lWZvv75dbnhYz2ORKqrh7NsXItSO3FUWRX5/20TaTcfXYXXPVNeUo7eUo+vwGOf0Ah1jv/astP+MpdNyxre9J4yuR9y+xA/Eb4zBYwWVeBzrcTof7Qo+NukdVRTvWPPT3yyVa6HuPjYwxTXU9QmxkjOmun7jk23TPxoYd3bMpxud218BHZ46NqJdvqqt9ekQ9bhIbHaa9HEif3yCbH+CQ6n1sblTq5muxkVlmB+o3aDpJuYUOERsNaLFR9/xrX/92VdP9q70ktEnR1+9n4PQ4sZFZsdnrmSE+zo8n+lf7R/6bPTbygrP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iJK+kqpg77ZWY9C52vYcin5lOzg2i2tvO73azarZV0/iqK413+T+zizq4YHFu/jPGN2ho9N2fJKejOCHlg7K+kf3Z7ds0laOZR6PwAAnIATnKeWgfOddTpBW9duT46zZhexE3tiR2wAAIgBsRGgvKMQDBWsBOwJAADHA7ERAAAAAMAIYiMAAAAAgBHERgAAAAAAI4iNAAAAAABGEBsBAAAAAIwgNgIAAAAAGEFsBAAAAAAwgtgIAAAAAGAEsREAAAAAwMh/z/kHlQGlOlkAAAAASUVORK5CYII=" alt="" />

对于像我这样的PHP小白来说,这些很实用的数组函数还是很值得积累一下。以下代码是在二次开发zentao(禅道)php框架编写的,其中就涉及到以上的三个知识点。

public function getDataOftasksPerAssignedTo()
{
$datas = $this->dao->select('t1.assignedTo AS name,t1.finishedBy,t1.closedBy')
->from(TABLE_TASK)->alias('t1')
->where($this->reportCondition())
->fetchAll(); if(!$datas) return array();
if(!isset($this->users)) $this->users = $this->loadModel('user')->getPairs('noletter');
$ary1 = array();
foreach($datas as $account => $data)
{
if ($data->name == 'closed'){
if (!empty($data->finishedBy)){
$data->name = $data->finishedBy;
}else if(empty($data->finishedBy) && !empty($data->closedBy)){
$data->name = $data->closedBy;
}
}
Array_push($ary1, $data->name);
}
$ary2 = array_count_values($ary1);
foreach ($datas as $key => $value){
$value->value = $ary2[$value->name];
$keys = $value->name; //取出要作为key的字段
$datas[$value->name] = $value; //赋值
unset($datas[$key]);
if(isset($this->users[$value->name])) $value->name = $this->users[$value->name];
}
return $datas;
}

#PHP 数组添加元素、统计数组相同元素个数、改变数组key值~_~的更多相关文章

  1. jdk1.8 ConcurrentHashMap 的工作原理及代码实现,如何统计所有的元素个数

    ConcurrentHashMap 的工作原理及代码实现: 相比于1.7版本,它做了两个改进 1.取消了segment分段设计,直接使用Node数组来保存数据,并且采用Node数组元素作为锁来实现每一 ...

  2. [LeetCode283]Move Zeros将一个数组中为0的元素移至数组末尾

    题目: Given an array nums, write a function to move all 0's to the end of it while maintaining the rel ...

  3. 删除数组里含有a的元素,并且将null值放在后面

    想去掉里面含有a的元素,并将null放在后面.放在后面就是往后移,其他值往左移 1 public static void main(String[] args) { 2 //自定义的一个数组 3 St ...

  4. python统计列表内元素个数

    代码如下: list01 = ['a','b','c','a','c'] set01 = set(list01) print(set01) dict01 = {} for item in set01: ...

  5. 《剑指offer》第三_一题(找出数组中重复的数字,可改变数组)

    // 面试题3(一):找出数组中重复的数字 // 题目:在一个长度为n的数组里的所有数字都在0到n-1的范围内.数组中某些数字是重复的,但不知道有几个数字重复了, // 也不知道每个数字重复了几次.请 ...

  6. perl数组的长度与元素个数

    perl数组的长度与元素个数 $#数组名 ---表示数组中最后一个元素的下标,它等于元素个数减1. @数组名 ---表示数组中元素的个数. $标量=@数组名 ---将一个数组赋值给一个标量变量,标量得 ...

  7. 函数bsxfun,两个数组间元素逐个计算的二值操作

    转自http://www.cnblogs.com/rong86/p/3559616.html 函数功能:两个数组间元素逐个计算的二值操作 使用方法:C=bsxfun(fun,A,B) 两个数组A合B间 ...

  8. [Swift]多维数组的表示和存储:N维数组映射到一维数组(一一对应)!

    数组:有序的元素序列. 若将有限个类型相同的变量的集合命名,那么这个名称为数组名.组成数组的各个变量称为数组的分量,也称为数组的元素,有时也称为下标变量.用于区分数组的各个元素的数字编号称为下标.数组 ...

  9. js获取对象、数组的实际长度,元素实际个数

    /*获取对象.数组的长度.元素个数 *@param obj 要计算长度的元素,可以为object.array.string */ function count(obj){ var objType = ...

随机推荐

  1. cannot launch node of type [arbotix_python/arbotix_driver]: arbotix_python

    这个时候提示错误: ERROR: cannot launch node of type [arbotix_python/arbotix_driver]: arbotix_python ROS path ...

  2. Springboot-读取核心配置文件及自定义配置文件

    读取核心配置文件 核心配置文件是指在resources根目录下的application.properties或application.yml配置文件,读取这两个配置文件的方法有两种,都比较简单. 核心 ...

  3. 在linux下设置定时任务

    输入命令 crontab -l(列出当前有哪些定时任务)crontab -e(修改这些任务)然后编辑:添加定时任务(编辑命令是vi编辑器的,tips:i,insert;:wq,保存并退出)格式:* * ...

  4. LWIP内存管理

    LWIP是一种TCP/IP协议栈,与嵌入式操作系统一样也提供了内存管理. 内存池里面有多个同样大小的内存,不同类型的内存池其里面的内存大小不一样.

  5. Java Persistence with MyBatis 3(中文版) 第五章 与Spring集成

    MyBatis-Spring是MyBatis框架的子模块,用来提供与当前流行的依赖注入框架Spring的无缝集成. Spring框架是一个基于依赖注入(Dependency Injection)和面向 ...

  6. modifiers标量调节器插件的定义和使用

    在插件目录plugins里新建文件 modifier.插件名.php文件(如 modifier.插件名.php)例:function smarty_modifier_test($utime, $for ...

  7. smarty中用truncate来截取中英文字符串及避免中文乱码问题

    smarty中用truncate来截取含有中英文的字符串,可能会出现中文乱码问题.字符串截取长度不一问题,下面是新建个扩展函数,或修改原Truncate函数方法也可以的.扩展smarty/plugin ...

  8. 全面剖析Smarty缓存机制二[清除缓存方法]

    前段时间,写了一篇 Smaryt缓存机制的几种缓存方式 ,详细介绍了三种缓存方式:全局缓存.部分缓存.局部缓存,以及通过is_cache()判断是否存在缓存来进行缓存生成.本来这篇早该完成,由于时间关 ...

  9. MySQL语句基础

    该笔记使用的数据库为MySQL-5.6.34,使用的建表语句为 : /* Navicat MySQL Data Transfer Source Server : 127.0.0.1 Source Se ...

  10. CentOS 7.2安装zabbix 3.0 LTS

    1.zabbix简介 zabbix(音同 zæbix)是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案. zabbix能监视各种网络参数,保证服务器系统的安全运营:并提供 ...