In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
The knowledge of this article "php how to remove the two values of the array" is not quite understood by most people, so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "php how to remove the two values of the array" article.
Two methods to remove: 1, call the unset () function twice to delete the two elements, syntax "unset (array name [subscript / key name])"; 2, use the array_splice () function to delete two elements from the specified location of the array, syntax "array_splice ($arr, start position, 2)".
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
Two methods for php to remove two values of an array
Method 1: call the unset () function twice to delete two elements
The unset () function deletes a specified element
Syntax:
Unset (array name [subscript]); / / delete an element in the indexed array unset (array name ["key name"]); / / associate an element in the array
Example 1:
Example 2:
Method 2: use the array_splice () function
When the array_splice () function deletes some elements of an array, it combines those deleted elements into a new array.
Example 1: delete 2 elements of the array from the beginning
Example 2: delete 2 elements of the array after the first element
Example 3: delete 2 elements of the array after the second element
The above is the content of this article on "how to remove the two values of the array from php". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.