In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you "what is the basis of php grammar", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what is the basis of php grammar" this article.
Keyword global:
It is used to enable a function to call an external variable, but it does not superglobalize the variable. Instead, 1, a local variable is defined inside the function and the name of the local variable is exactly the same as the name of a global variable outside! 2. Make a copy of the address of the value of the outer global variable and pass it to the local variable defined within the function (use $GLOBALS as much as possible in programming, because it really defines a superglobal variable)
Static local variables:
Its keyword is defined as: static
Features: after each call to the function, the static local variables are saved and will not disappear (you can continue to use it the next time you call the function), but when the function call ends, it also ends.
Recursive function:
The function calls itself.
Two elements of recursion:
Recursive exit: when to stop calling yourself and when to start calling yourself
Recursive point: when do you start calling yourself?
(generally write recursive exit first and then recursive point)
The iterative idea is to solve the problem later, reflected in the code, which is actually the repeated execution of a step, that is, the loop structure.
Time function:
Date: use time format placeholders to format the specified timestamp into the corresponding format, such as: date (Y); output 2016 Y represents the year.
Strtotime: convert a time string in English format into a timestamp!
Such as strtotime ("2016-9-10"); will be converted to a timestamp
Time function:
Date: use time format placeholders to format the specified timestamp into the corresponding format, such as: date (Y); output 2016 Y represents the year.
Strtotime: convert a time string in English format into a timestamp!
Such as strtotime ("2016-9-10"); will be converted to a timestamp
Create an array:
Explicitly create:
$arr=array (
'Keyname'= > 'value'
Key name 1 value = > 'value 1'
Key name 2keys = > 'value 2'
)
Implicitly create:
$arr ['key name'] = 'value'
$arr ['key name 1'] =' value 1'
$arr ['key name 2'] =' value 2'
$arr ['key name 3'] =' value 3'
Var_dump ($arr)
Array classification:
1. Indexed array: the key of an array element that is not used to represent the meaning of its value, but only the position of the element within the entire array.
two。 Associative array: there is an one-to-one corresponding relationship between the key and the value of the exponential group element, that is, the key represents the meaning of its value!
These are all the contents of this article entitled "what are the foundations of php Grammar?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, 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.