Method for PHP to find a specific value in a multidimensional array

Source: Internet
Author: User
Tags learn php
  1. Public Function Searcharray ($array, $key, $value) {
  2. foreach ($array as $keyp = = $valuep) {
  3. if ($valuep [$key]== $value) {
  4. Unset ($array [$KEYP]);
  5. }
  6. }
  7. return $array;
  8. }
  9. ?>
Copy Code

you may be interested in the article:PHP creates an array of methods introduced PHP uses Array_unique to determine if the same value exists in the array php array function In_array () Find out if there is a specified value in the array php array function array_key_ Exists () find the array key name if there is a small example of php array de-weight php function array_merge () Usage example (merging homogeneous array) enhanced version of Array_unique function (supports two-dimensional array) Learn PHP multi-dimensional array sorting php multidimensional array sorting examples of PHP array functions in understanding PHP Arrays callback Filter function Array_filter () Examples of applications PHP extracts variables from an array of functions and application instances PHP code that sorts a multidimensional array by a value randomly extracts some elements of PHP code using PHP arrays for the content of the article automatically linked code PHP add and delete array elements method

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.