Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How PHP checks for the existence of a value in _ array function in an array

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces PHP how to check the existence of a value in _ array function in the array, the content is very detailed, interested friends can refer to, hope to be helpful to you.

The PHP in_array () function checks whether a value exists in the array and returns TRUE if so, FALSE otherwise.

Syntax:

Bool in_array (mixed needle, array array [, bool strict])

Parameter description:

Parameter indicates the value that needle needs to search in the array. If it is a string, the array strict to be retrieved by case-sensitive array is optional. If set to TRUE, the value types in needle and array are also checked.

Example:

The output of the example is as follows:

An example of strict checking of the character an in the $arr_a array:

The output of the example is as follows:

The character 1 does not exist in the $arr_a array as an example of needle:

The output of the example is as follows:

The array $arr_b exists in the $arr_a array

About PHP how to check the existence of a value in the array in _ array function to share here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report