In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to use each in php". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor learn how to use each in php.
In PHP, the each () function returns the key name and key value of the current element and moves the internal pointer forward; this function can generate an array of element key names and key values pointed to by the current internal pointer of the array. If the internal pointer goes beyond the range of the array, the result returned by the function is false and the syntax is "each (array)".
This article operating environment: Windows10 system, PHP5.6 version, Dell G3 computer
What is the use of each in php
The each () function returns the key name and key value of the current element and moves the internal pointer forward.
The key name and key value of the element are returned to the array with four elements. Two elements (1 and Value) contain key values, and two elements (0 and Key) contain key names.
Each (array)
Array is required. Specifies the array to be used.
Description
The each () function generates an array of key names and key values of the elements that the array's current internal pointer points to, and moves the internal pointer forward.
There are four elements in the returned array: the keys are 0Magne1, rekey and value. Cell 0 and key contain the key name of the array unit, and 1 and value contain data.
This function returns FALSE if the internal pointer goes beyond the range of the array.
Examples are as follows:
Output result:
Tip: the each () function is deprecated in PHP 7.2.0.
At this point, I believe you have a deeper understanding of "how to use each in php". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.