Home>Article>Backend Development> Li Yanhui PHP video tutorial season 1 resource sharing

Li Yanhui PHP video tutorial season 1 resource sharing

黄舟
黄舟 Original
2017-08-30 16:18:13 3176browse

php is one of the most popular languages currently. As a master figure in the PHP training industry, Li Yanhui's course explanations are clear and comprehensive. His PHP tutorial video is a classic and widely circulated on the Internet. This course is his first season video, about the basic knowledge of php.

Li Yanhui PHP video tutorial season 1 resource sharing

Course playback address://m.sbmmt.com/course/392.html

The teacher’s teaching style:

The teacher’s lectures are vivid, witty, witty, and touching. A vivid metaphor is like the finishing touch, opening the door to wisdom for students; an appropriate humor brings a knowing smile to students, like drinking a glass of mellow wine, giving people aftertaste and nostalgia; a philosopher's aphorisms, cultural references Proverbs are interspersed from time to time in the narration, giving people thinking and warning.

The more difficult part in this video is the PHP custom function:

Generally speaking, redundant code is bad. Rewriting the code again and again is not only a waste of time, but also looks shoddy from a layout and structure perspective. Like all good programming languages, PHP uses many methods to alleviate the problem of redundant code. The most common and easiest to implement method is to use functions.

one. Standard functions

There are more than 1,000 standard functions in the standard PHP distribution package. These standard functions are built into the system and can be used directly without the need for users to create them themselves.

2. Custom functions

PHP built-in functions allow interacting with files, using databases, creating graphics, and connecting to other servers. However, in actual work, there are many times when things are needed that the creators of the language could not foresee.

Declaring a function allows us to use our own code like built-in functions. Simply call this function and provide it with the necessary parameters. This means that the same function can be called and reused multiple times throughout the script.

Create function

Call function

Function naming

1. The function name cannot be the same as the existing function name name.

2. The function name can only contain letters, numbers and underscores.

3. The function name cannot start with a number.

Function call containing parameters and no return

Function call containing parameters and returning: Use the return() statement to report to the function caller Returns an arbitrary deterministic value, returning program control to the caller's scope.

Function call containing default parameters: You can specify a default value for the input parameter. If no other value is provided, the default value will be automatically assigned to the parameter.

Function call that returns multiple values: It can be constructed by returning an array and then using the list() function.

Function calls containing parameters passed by reference: Passed by reference, modifications to parameters within the function can also be reflected outside the scope of the function.

'; echo $tax; ?>

Please note that function calls will not be case-sensitive, so calling functionname(), FunctionName(), or FUNCTIOINNAME() are all valid and will all return the same results. For convenience, all are in lowercase here.

It is important to note that function names and variable names are different. Variable names are case-sensitive, so $Name and $name are two different variables, but Name() and name() are the same function.

The above is the detailed content of Li Yanhui PHP video tutorial season 1 resource sharing. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn