当前位置:网站首页>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 ';
}
边栏推荐
- [QT] QT uses qjson to generate JSON files and save them
- JVM details
- [binary search tree] add, delete, modify and query function code implementation
- Problem solving win10 quickly open ipynb file
- Chapter 16 oauth2authorizationrequestredirectwebfilter source code analysis
- NSSA area where OSPF is configured for Huawei equipment
- Use mapper: --- tkmapper
- 18. (ArcGIS API for JS) ArcGIS API for JS point collection (sketchviewmodel)
- Permission problem: source bash_ profile permission denied
- Determinant learning notes (I)
猜你喜欢
Laser slam learning record
18. (ArcGIS API for JS) ArcGIS API for JS point collection (sketchviewmodel)
NSSA area where OSPF is configured for Huawei equipment
wx. Getlocation (object object) application method, latest version
Key structure of ffmpeg - avframe
[designmode] composite mode
Qt QPushButton详解
How to get all the values stored in localstorage
软件测试工程师必会的银行存款业务,你了解多少?
What if the C disk is not enough? Let's see how I can clean up 25g of temp disk space after I haven't redone the system for 4 years?
随机推荐
Qt 一个简单的word文档编辑器
How much do you know about the bank deposit business that software test engineers must know?
VBA fast switching sheet
Mathematical model Lotka Volterra
Determinant learning notes (I)
MySql——CRUD
Problem solving win10 quickly open ipynb file
权限问题:source .bash_profile permission denied
Teach you to run uni app with simulator on hbuilderx, conscience teaching!!!
Detailed explanation of APP functions of door-to-door appointment service
JS 这次真的可以禁止常量修改了!
【GYM 102832H】【模板】Combination Lock(二分图博弈)
What are Yunna's fixed asset management systems?
CloudCompare&PCL 点云随机添加噪声
QT -- thread
Upgrade openssl-1.1.1p for openssl-1.0.2k
转:未来,这样的组织才能扛住风险
单商户V4.4,初心未变,实力依旧!
MySQL global lock and table lock
Shardingsphere source code analysis