In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
In this issue, the editor will bring you what knowledge about the PHP associative array. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
Function can make our code very simple, recently read a lot of knowledge about PHP, here to introduce you to the knowledge of PHP associative array. Describes the international extract object (array $var_array [abstract $extract_type = EXTR_OVERWRITE [, string $prefix]]) imports an array of variables into the current symbol table. Check each key to see if it has a legal variable name.
It also checks the collision with the existing variable symbol table, PHP associative array. This function takes the key as the variable name and value as the value of the variable. For each key / value pair, a variable is created in the current symbol table, subject to extract_type and prefix parameters. You must use associative arrays, and a numeric indexed array will not produce results unless you use EXTR_PREFIX_ALL or EXTR_PREFIX_INVALID.
The way invalid / numeric keys and collisions are treated by extract_type. It can be one of the following values:
◆ EXTR_OVERWRITE overwrites existing variables if there are collisions.
If ◆ EXTR_SKIP has collisions, do not overwrite existing variables.
If ◆ EXTR_PREFIX_SAME has collisions, the prefix of the variable name of the prefix.
The prefix of all variable names of the ◆ EXTR_PREFIX_ALL prefix.
◆ EXTR_PREFIX_INVALID only prefixes variable names with invalid prefixes / digits.
◆ EXTR_IF_EXISTS can only override a variable, if it already exists in the current symbol table, otherwise, do nothing. It is useful to define the list of valid variables, and then extract only those variables you defined the $_ REQUEST array.
◆ EXTR_PREFIX_IF_EXISTS only creates prefix variable names if the non-prefix version of the same variable exists in the current symbol table.
Reference to the ◆ EXTR_REFSextract variable. This actually means that the import of values still refers to the value of the variable, the var_array parameter. You can use this flag on your own or in combination with any other logo for OR'ing 's extract_type.
If not specified by extract_type, this is assumed to be EXTR_OVERWRITE. Please note that only prefixes are required if extract_type is EXTR_PREFIX_SAME, EXTR_PREFIX_ALL, EXTR_PREFIX_INVALID or EXTR_PREFIX_IF_EXISTS. If the prefix result is not a valid variable name, it is not imported into the symbol table. A key prominent feature of the prefix automatic departure from the array. Returns some variables that are successfully imported into the symbol table. Version note 4.3.0 EXTR_REFS has been added. 4.2.0 EXTR_IF_EXISTS and EXTR_PREFIX_IF_EXISTS have increased. 4.0.5 this feature now returns some variables extract. EXTR_PREFIX_INVALID increased. EXTR_PREFIX_ALL includes numeric variables as well as.
PHP associative array instance
For example: the example of extract object ()
One possibility for extract objects () is to import them into symbolic table variables that contain associative arrays that return wddx_deserialize ().
The above is the knowledge of PHP associative array shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to 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.