当前位置:网站首页>PHP determines whether an array contains the value of another array
PHP determines whether an array contains the value of another array
2022-07-06 00:09:00 【Enron 303】
in_array() function
Briefly :in_array($needle, $array[, $strict = FALSE])
Altogether 3 Parameters ,
The first parameter is the value to check ( the latter ), It can be an array or a specific value .
The second parameter is the array to check ( The former ), ditto .
The third one doesn't have to write , The default is false, It's written in true We have to compare whether the data types are the same .
I think the third one is very necessary . Sometimes there will be problems if you don't write .
Another basic usage is that an array contains a value , But if you want to include another array , Only when another array is a complete subarray of the original array , I tried some that should be like this . There are cases in the link at the beginning . Be sure to look at the case !
if(in_array('SB',$params,true))
{
echo ' There are illegal characters ';
}
边栏推荐
- [SQL] SQL expansion languages of mainstream databases (T-SQL, pl/sql, pl/pgsql)
- Hudi of data Lake (2): Hudi compilation
- Make a short video clip number of we media film and television. Where can I download the material?
- [day39 literature extensive reading] a Bayesian perspective on magnetic estimation
- 跟着CTF-wiki学pwn——ret2libc1
- The global and Chinese markets of dial indicator calipers 2022-2028: Research Report on technology, participants, trends, market size and share
- 18. (ArcGIS API for JS) ArcGIS API for JS point collection (sketchviewmodel)
- Knowledge about the memory size occupied by the structure
- Global and Chinese market of water heater expansion tank 2022-2028: Research Report on technology, participants, trends, market size and share
- 硬件及接口学习总结
猜你喜欢
【NOI模拟赛】Anaid 的树(莫比乌斯反演,指数型生成函数,埃氏筛,虚树)
Redis high availability - master-slave replication, sentinel mode, cluster
Huawei equipment configuration ospf-bgp linkage
Configuring OSPF load sharing for Huawei devices
Teach you to run uni app with simulator on hbuilderx, conscience teaching!!!
Senparc.Weixin.Sample.MP源码剖析
How to rotate the synchronized / refreshed icon (EL icon refresh)
QT QPushButton details
wx. Getlocation (object object) application method, latest version
Gavin teacher's perception of transformer live class - rasa project actual combat e-commerce retail customer service intelligent business dialogue robot system behavior analysis and project summary (4
随机推荐
Hudi of data Lake (1): introduction to Hudi
提升工作效率工具:SQL批量生成工具思想
How to rotate the synchronized / refreshed icon (EL icon refresh)
CAS and synchronized knowledge
Problem solving win10 quickly open ipynb file
Qt QPushButton详解
Global and Chinese market of water heater expansion tank 2022-2028: Research Report on technology, participants, trends, market size and share
Make a short video clip number of we media film and television. Where can I download the material?
上门预约服务类的App功能详解
Configuring OSPF load sharing for Huawei devices
Mathematical model Lotka Volterra
Initialiser votre vecteur & initialisateur avec une liste Introduction à la Liste
Wechat applet -- wxml template syntax (with notes)
[SQL] SQL expansion languages of mainstream databases (T-SQL, pl/sql, pl/pgsql)
Recognize the small experiment of extracting and displaying Mel spectrum (observe the difference between different y_axis and x_axis)
[noi simulation] Anaid's tree (Mobius inversion, exponential generating function, Ehrlich sieve, virtual tree)
【DesignMode】适配器模式(adapter pattern)
14 MySQL view
Single merchant v4.4 has the same original intention and strength!
Doppler effect (Doppler shift)