PHP Learning notes PHP Array Summary

Source: Internet
Author: User
    1. foreach ($arr as $key = $value)
    2. {
    3. echo $value. "
      ";
    4. }
Copy Code

2), when the assignment is made with $arr[], the bidding clubs under the array is subscript with the current maximum subscript +1 ($arr [Maximum +1]). Example:

 
 
      $value) {echo $key. ' = '. $value. "
"; } Output:/*0 =11 =str2 =4 =45 =xint2 =76 =xx*/?>

4, in PHP, the array is self-increment, and in C + + is different 5, about the function of the array 1), count the number of statistics array. 2), IsArray to determine if a variable is not an array of 3), explode text segmentation. 4), unset destroy the elements of a variable or array. Unset does not change the sequence of the array after it is destroyed. 6, the array operator $a+ $b to add array B to the array a, removing the same key. The same key is not overwritten. The digital subscript is the same

 
      = FSDFSS [c] = Lengai)?>

Code Description: $a = = $b arrays A and array B key values are the same $a = = = $b The array A and B are not just the same as the key values, but the order must be the same. $a <> $b arrays A and array B are not the same. $a!== $b arrays A and array B are not congruent. Let's summarize these, hope to help you. To learn PHP programming, you come to the programmer's home.

  • 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.