Getting started with Learn PHP online. Part I


Contents:


Translators, interpreters, compilers
In this lecture we will reveal the basic concepts of translators, interpreters and compilers. When ...
How does PHP work?
In this lecture we will learn what PHP is and how it works. Let's look at an example. We need to sp...
PHP Tags
code {color: # 339} In order for the HTML parser to identify the code as PHP, it need...
Including PHP code in HTML
In the previous lecture, we introduced you to the PHP tags. As already mentioned, they serve to inse...
Displaying data with echo
code {color: # 339} For вывода на экран данных , whic...
Comments
Комментарий is a piece of code that is ignored by the interpreter ...
Execution of PHP scripts from the command line
It is important to note that PHP scripts can be executed not only when accessing the server, but als...
Instructions
Инструкцией (statement) call a line of code that is equivalent to ...
Common Errors
In this lesson (and in the following similar ones) we will consider основные ошибки
What is a variable
Переменной you can name a reserved named area of memory in which d...
PHP data types
Consider the list типов данных in PHP. First of all, it is necessa...
Boolean type
Логический or булев a type ( ...
Numeric data types
In PHP, there are two types of data for representing numbers: integer (or int
Rows
String data type values string are some sequences of characters - words, sentences, in...
NULL data type
NULL is a special type that allows only one value in the form of a keyword
What is an array?
Consider the question of such a concept as массив . Previously, we...
Chisel-index arrays
Consider массивы в PHP . They come in two types - чи...
Using print_r
As noted in the previous lesson, arrays can not be displayed using the function echo, ...
Associative arrays
In this lesson, consider the concept of an associative array. Ассоциативный массив
Multidimensional Arrays
What happens if we want to put an array inside an array? We get an array in an array or
Using var_dump
As already noted in the previous lessons, we can not derive the values false and
Constants
Константы - this is almost the same as the variables. They have
Variables of variables
In this lesson, we'll look at a very useful topic from the point of view of understanding the writin...
References
In this lesson a very important topic will be revealed - ссылки . ...
Type casting (scalar types)
Приведение типа (Type Casting) is the process of...
Type casting (arrays)
Separately it is necessary to consider the transformation of arrays into simple types and vice versa...
Other types of data
In PHP, there are several more types of data: объект (Object) ,
Predefined variables
Предопределенные переменные is a set of variables that are defined ...
Using isset
In this lesson, let's look at the use of the function isset() . This function is inte...
Removing a variable with unset
Function unset() intended for " уничтожения "("
Serialization
Сериализация is the process of converting structured data into a s...
Common Errors
Here are the main errors that can occur when working with variables and considered data types.
Arithmetic Operators
Let us consider the question of arithmetic operators. To do this, let's define what the operator mea...
Increment and decrement operators
Operators инкремента and декремента
String operators
Consider two string operators: concatenation operator . (dot)concate...
Logical Operators
TO логическим операторам include operators that are used for values...
Assignment operators
The assignment operator = is used to assign a value to a variable. The variable is wri...
Comparison Operators
These operators help сравнивать The value on the left with the val...
Array Operators
The operators of arrays represent a separate category of operators. With some of them we have alread...
Error management operator
In PHP, there is an error control operator (it is also called an error suppression operator). If you...
Operator Priority
As already noted in the previous lessons, when using different operators in the same expression, the...
Command Execute Operator
code {color: # 339} PHP has an operator that can send команды
How to execute the instructions
Порядок выполнения - this is in what order the instructions that we...
Condition constructs: if/else/elseif
Конструкции условий (conditional structures) allow at some stage of...
Ternary operator
Тернарный оператор ? : is one of the comparison oper...
The switch/case
Design switch/case is an analog of the construction with the condition. This construct...
Cycles: for
In this lecture we begin to consider a series of control structures called циклы
Cycles while/do-while
Another variety of the cycle are constructions while and do while. These...
Foreach cycle
Let's consider one more kind of a cycle - foreach. It is intended for enumeration of a...
Alternative syntax: if, for, while, foreach
In PHP there is a so-called. альтернативный синтаксис conditional ...
Instructions break & continue
To intentionally exit the structure, or go to the next iteration, there are special instructions
Exit & die statements
Like instructions break, there are instructions exit and die
Common Errors
Consider the main errors that programmers often allow, using control structures. На...
Modes of work with files
In this lesson, consider the modes that are available to work with файлами ...
Write to file
For записи a function is used fwrite($handler, $data)
Reading data from a file
For чтения from the file the function is used fread($handle...
Locking and deleting files
When working with files (create, read, write), there can be situations when the file will be opened ...
Including files
In PHP, it is possible to include the contents of files as source code. To do this, use the instruct...
String Functions
In PHP, there is a very large set of functions that work with strings. Consider the basic functions ...
Functions for working with arrays
In PHP, there are many functions for working with arrays. Let's consider some of them: count...
Functions for working with files
Let's consider some useful function for working with файлами .
Regular expressions
Регулярное выражение (Regular Expression) is a special string that ...
Functions for regular expressions
To work with regular expressions in PHP, there are a number of functions. Let's consider some of the...
Creating functions in PHP
As we already know, PHP has a large number of predefined функций . A...
Calling up created functions
In the previous lesson, we reviewed the rules for создания functio...
Arguments and Parameters
In the previous lessons, we considered examples of functions without arguments (parameters). Let us ...
Optional arguments
In determining the functions that depend on the parameters, it is possible to determine the so-calle...
Scope of Visibility
When we define the body of a function (in which the arguments of a function are passed), we thereby ...
Passing arguments by reference
As it was already noted in the previous lesson when changing a variable (which is passed from the gl...
Returning values to functions
Previously, in the examples we defined functions that did not return values. Consider the question o...
Recursive Functions
Рекурсия is a process that means investing some entity in itself. ...
Calling a function with a variable
In one of the previous lessons, we talked about calling a function from the program code. Recall tha...
Anonymous functions
PHP uses анонимные functions ( замыкания, кложуры ...
Functions for working with functions
In this lesson, we'll look at some useful functions for working with functions in PHP. funct...
Create a registration form with saving data to a file
code {color: # 339}We use the skills of working with the file system to store informa...