Php method for searching specific values in multi-dimensional arrays
- Public function searchArray ($ array, $ key, $ value ){
- Foreach ($ array as $ keyp => $ valuep ){
- If ($ valuep [$ key] ==$ value ){
- Unset ($ array [$ keyp]);
- }
- }
- Return $ array;
- }
- ?>
Articles that you may be interested in: Introduction to the php method for creating arrays. php uses array_unique to determine whether the same value exists in the array. php array function in_array () search for the existence of the specified value in the array php array function array_key_exists () search for the existence of the array key name php array deduplication example php function array_merge () usage example (merge similar arrays) enhanced version of the array_unique function (supports two-dimensional arrays) learning php multi-dimensional array sorting example of php multi-dimensional array sorting understanding of several array functions in php array callback filtering function array_filter () application example php extract the variable function from the array and application instance to the multi-dimensional array by a certain value of the php code from the array to randomly extract some elements of the php code using the php array for the article content php code that automatically adds links to add and delete array elements |