Learning to program is a complex and lengthy process. Mastering the syntax of the language is only the first step, without which it is impossible to move on. This course introduces the basics of writing programs in PHP and lays a solid foundation for creating complete and meaningful solutions.
PHP is one of the most popular programming languages in the world. More than 80% of websites on the Internet are written in this language. We will study PHP from scratch, from the very basics. The first module is a springboard for writing meaningful programs. In it, we will analyze how to write your first code in PHP. We will tell you what comments are and why they are needed. Using the example of checking your solutions, we will consider what testing is and how to read test output.
Modern programs are created to serve businesses, help in everyday life and entertainment. But their work is still based on calculations. The simplest and most basic topic in programming is arithmetic. In this module, we will translate arithmetic operations into a programming language, talk about the priority of operations. We will tell you what a linter is and why it can “swear”.
Text in programming is called “strings”, and this topic is not as simple as it may seem. How to output a phrase that contains both single and double quotes? What to do with text at all, because the computer does not know anything about letters! The module is dedicated to various aspects of writing text – from quotes and escaping to encoding.
PHP is a weakly typed language with immutable primitive data types. What happens if we try to multiply a number by a string? How does PHP know what type of data is in front of it? And what does PHP do when it sees a type mismatch? You will find the answers to these questions in the current module.
Information can be stored in special “storages” – variables. This allows you to reuse existing data and avoid duplicating it in different parts of the code. In this module, we will look at how to change variables and give them clear names so that the code is understandable for any developer. You will understand that choosing the right variable name can be a difficult task! We will also tell you how to use variables to simplify complex calculations.
To express any arbitrary operation in programming, there is a concept called a “function”. Functions are the building blocks from which programmers build systems. In this module, we will learn how to use already created functions. We will look at the function signature in the documentation and figure out how to use it. We will get acquainted with standard libraries that store thousands of functions. It is impossible to learn all the functions, but every programmer should know where to look for documentation on them.
Defining your own functions makes it much easier to write and maintain programs. For example, the ability to define functions allows you to combine complex (composite) operations into one – all the complexity can be hidden behind one simple function. By learning how to write functions, you will take the first step towards building truly useful programs. And we will help you with this. In this module, you will create your first function and learn how to give it (and variables and constants) understandable names.
Logical expressions allow you to answer questions that arise during the program’s operation. Is the user authenticated? Is the subscription paid? Is this a leap year? In this module, we study predicate functions – those that ask and answer a question – whether it is true or false. We will practice writing such functions and move on to more complex logical expressions.
The purpose of a predicate function is to get an answer to a question, but this is usually not enough and a certain action must be performed depending on the answer. If and Switch are PHP constructs that allow a programmer to select the required program behavior depending on different conditions: skip some instructions and execute others. We will examine them in practice in this module.
Any code can be repeated tens, thousands, millions of times. In combination with other tools we know – variables and conditions – this opens up many possibilities for building programs and complex systems. Let’s give a simple example. You need to find a specific phrase in a 500-page textbook. You remember the phrase, but not the page number. The simplest (and longest) way is to sequentially look through the pages until you find the right one. Cycles are needed to perform such repetitive actions.
Modern string encoding and work with them in PHP, using functions for multi-byte encodings. Localization.
The concept of time in computers. Hardware and System timers. Functions for working with date and time in PHP. Time zones
Phone: +375 33 910-08-92
Email: info@codefor.tech
Address: Baranovichi, st. Pirogova, 7
© 2024-2025 All rights reserved. CodeFor.
Site language: