当前位置:网站首页>Array collation commonly used in PHP
Array collation commonly used in PHP
2022-07-28 09:53:00 【MountainYanYL】
PHP Common array functions
// Key names and values of arrays
array_keys() Key in array
array_values() The values in the array
in_array() Determine whether it is in the array
array_key_exists () Whether there is a key
array_flip() Value and key exchange
array_search() Search the array for a given value , If successful, return the corresponding key name
// Segmentation and filling of arrays
array_slice() Take a segment from the array
array_splice() Remove part of the array and replace it with other values
array_pad () Fill the array with a value to the specified length
// Stack And queues
array_push() Element stack
array_pop() Element out of stack
array_shift() Move the beginning of the array out
array_unshift() At the beginning Insert one or more units
// Array sorting
array_multisort() // It can be used to sort multiple arrays at once , Or sort multidimensional arrays according to one or more dimensions .
sort() ksort() krsort()
asort() asort()
// Array calculation
array_sum() Array sum
array_merge () Array merge
array_diff () Difference set of array
array_unique() Remove duplicate values from the array
shuffle() Array scrambling
array_rand() Select one or more cells randomly from the array
compact() Create an array containing keys and values
array_chunk () Divide the array into pairs
边栏推荐
- 数据库高级学习笔记--游标
- Source code analysis of activityrouter
- ConsoleAppender简介说明
- C form application uses object binding DataGridView data binding
- WPF布局之控件随着窗口等比放大缩小,适应多分辨率满屏填充应用
- Window source code analysis (I): things with decorview
- LeetCode - 哈希表专题
- JS array is de duplicated, the ID is the same, and a value is added and merged
- 判断字符串是不是回文
- PlatoFarm进展不断,接连上线正式版以及推出超级原始人NFT
猜你喜欢
随机推荐
Some problems about CLR GC tuning
数据库高级学习笔记--存储结构
ActivityRouter源码解析
Learn a hammer.Net zero foundation reverse tutorial lesson 3 (shell and homework)
Common tool functions are constantly updated
能够遍历一个文件夹下的所有文件和子文件夹
Window源码解析(二):Window的添加机制
OpenAtom OpenHarmony分论坛,今天14:00见!附大事记精彩发布
路由器固件解密思路
数据库高级学习笔记--游标
Window源码解析(一):与DecorView的那些事
MATLAB启动慢解决措施
View事件分发机制源码解析
多线程一定能优化程序性能吗?
软件测试与质量学习笔记1---黑盒测试
Source code analysis of view event distribution mechanism
Seeing clearly is more important than walking fast, because you can go far only when you walk right
SQL server, MySQL master-slave construction, EF core read-write separation code implementation
ARouter源码解析(三)
3 minutes to tell you how to become a hacker | zero foundation to hacker getting started guide, you only need to master these five abilities









