Learning php from scratch. PHP Online: course for dummies


I’ll try to write recommendations in free form for the first few points.

First and most importantly, to learn PHP programming well, you need to learn programming well. This is a very important thing. Most people writing in PHP don't have the slightest idea about programming. Even about such basic things as code formatting, debugging, profiling, error handling, file operations. You may notice that I'm not talking about OOP. This is a completely separate topic; OOP must be taught specifically. Unfortunately, out of 100 people who say they know OOP, 90 are banal copy-pastors who have learned the syntax, but do not understand the meaning of objects. But to play chess, it is not enough to know how the pieces move.

It would also be nice to answer yourself the question - why do you want to learn programming in PHP? The question is not at all idle. Many people mix up a bunch of different concepts in it. For example, CMS has already been mentioned here. and indeed, if we are talking about making money, then customizing Jumla and writing shitty modules for it are much more financially profitable than the ability to write something from scratch. For freelancing, anyway.

In general, PHP can be used in many different ways. And for each case it will be its own language.

  • You can create a guest or business card website using “naked” PHP - and there is nothing bad or shameful about it. On the contrary, this is a plus of a language that is suitable for such purposes, without dragging along a couple of million lines of code for the sake of a site of five hundred.
  • You can write a professional portal, using one of the existing frameworks as a basis, and develop it.
  • You can write a custom highload project, for which you will need to write your own framework, again using bare PHP.
  • You can, as already mentioned, rivet sites based on some kind of CMS.

Lots of options! so you need to first decide what you want.

They talked about JS+CSS above - don’t listen, it’s complete nonsense. Frontend programming is a completely separate thing, much more visual than abstract. And, thank God, more and more employers are starting to understand this. Although, again, if you freelance and are a jack of all trades, then you can’t live without it.

But if you work as a hardcore server programmer in a team, then you only need to have a general understanding of HTML/JS/CSS (since texts in these languages ​​are, in fact, practically the only result of PHP’s work).

But what you definitely need to know well from related technologies is the HTTP protocol, file system structure, and working with the command line in Linux.

Now for the rest

Mysql is still the cornerstone of data storage on the web. You need to know and understand joins and indexes

Frameworks are a must. Here, however, there is a problem of choice, but there is no fundamental difference between them. Yii is a good choice.

You don't need Github, you don't need to know it. You need to know git.
But what is mandatory for a web programmer is the ability to use Google. At least at the level of ability to copy-paste an error message into a search form or write a question “What is git” ;-)

Because to work in a team you need to know some version control system, and git is a de facto standard. Understand the principle of operation and basic commands - checkout, commit, push.

The Internet in the modern world is occupying an increasingly strong position. About 15 years ago, access to the network required expensive equipment and a lot of money to pay bills. Now anyone with at least a mobile phone can access the Internet for pennies. More and more services are moving into electronic form. From a means of communication and information exchange, the Internet is turning into a convenient tool for doing business and making money.

Every day, millions of users visit their favorite sites, download email, files or news, play online games, conduct company business, or simply communicate in chat rooms, blogs and forums. Most of these users have never thought about how it all works, who creates new sites and services, how and with what help.

This electronic textbook is intended for those for whom it is not enough to simply surf the Internet. For those who want to learn how to create their own websites and keep up with the latest trends in programming and design.

General principles

Before you start learning a language, you need to clearly define the terminology and understand the general principles of the Internet. Let's start with the principles of the network and sites.

The Internet consists of a huge number of interconnected computers, routers and other hardware necessary for proper operation. Each element of the Internet (node) has a unique descriptor - an IP address. Knowing the IP address of a node, you can try to connect to it, and with a little skill you can determine who this address belongs to and in what region of the world it is located. IP addresses are usually written as four groups of numbers separated by dots, for example

192.168.100.003 or 10.10.0.123

Agree, remembering the addresses of all frequently visited pages is not an easy task. Therefore, there are special DNS (Domain Name Resolution) servers on the Internet that store lists of mapping IP addresses and symbolic names. It is thanks to these servers that the user always gets to the desired IP address by typing only the page name in the browser.

After we have entered the name of the desired page into the browser line, the browser independently receives the IP address of the desired server from the DNS and sends a special request to receive the page (HTTP request) to this address. A specialized program running on the server (the so-called Web server) processes this request and returns the required page to the browser.

Obviously, all actions for displaying a page can be clearly divided into two categories: those performed on the client side ( client code or front-end) and executed on the server side ( server code or back-end). Moreover, the server knows nothing about the current state of the client, and the client knows nothing about the current state of the server. When developing exchange algorithms, you must always remember this and timely transmit the necessary data describing the state or required action.

Depending on the place of application, the means of implementing the parts also differ. On the client side, typically only HTML, JavaScript (AJAX), CSS and Flash are used. Server-side developers are less strapped for money, because... Most existing languages ​​allow you to create or describe HTML pages. The most widely used today are Java, Perl, PHP, Python, Ruby, C# and VB.NET. Each of them has its own strengths and weaknesses, so the developer must make a choice based on the tasks facing him.

Why PHP?

There are a large number of languages ​​that can be used when creating websites. Some languages ​​have existed for a long time and are successfully used (or no longer used). Some languages ​​are still very young and have not yet received widespread use. Recently, PHP has become a leader in popularity, for several reasons:

  1. Simplicity. The language is very easy to understand, especially for novice programmers.
  2. Development speed. Thanks to its simplicity and intuitiveness, PHP allows you to create quite complex websites very quickly.
  3. Availability of libraries There are a huge number of ready-made examples and class libraries. Hundreds of libraries have been created and tested to significantly simplify the life of a developer.
  4. Support Almost every server on the Internet supports PHP
  5. Safety PHP allows you to create truly secure websites thanks to its built-in support for data encryption during storage and transmission.

However, PHP pays for its benefits with some limitations. For example, using PHP to access system functions is very inconvenient compared to Perl or Python (which is why many system administrators love Perl so much). There are several other limitations that we will talk about when studying the relevant sections.

From the author: on the World Wide Web, physical strength means nothing! You can press the keys with any force, but the result will not change. On the Internet, the one with more experience and knowledge is considered stronger. Although my friend “pumped up” the hardware of his PC so much that he became afraid of it! But this is with everything from the “iron” opera. And today we will find out where to start learning in PHP in order to become a strong programmer.

"Tea" disease

Of course, sorry, but you are a “teapot”. How did I guess? Well, because only beginners pose such questions to themselves. And there is nothing offensive in this “title”, because you have such a desire to learn that you can “boil.” And this is already a sign that everything will succeed!

Studying PHP, like any other science, should start from the very beginning, that is, from theory. You need to understand what this programming language is: its capabilities, main scope, features, and so on. This is an important aspect, since beginners, due to a lack of basic theory and general ideas about a particular language, often make mistakes in their choice. And then, with disappointed expectations, they quit training after several hours of “research.” I’ll try to lift this veil a little so that you understand not only where to start learning PHP, but also why.

A few features of the language that beginners should know:

PHP is most often used in website development, but it can also be used to develop client applications.

It is a server-side language - its code runs on the server side, so to study it you will need a local server or an appropriate assembly.

Close relationship with - if you are going to “storm” website building, you will have to learn the specified DBMS. We will help you with this.

Where is the beginning?

If you are planning to learn PHP programming but don’t know where to start, then this section is for you. You should start with the basics: with the features of the language syntax, data types, variables, their initialization, loops, function declarations, etc. Even if you studied all this in other software disciplines, you will have to familiarize yourself again, since PHP has a number of features.

But that will come later, but initially you need to decide on the basic literature for understanding software science. The choice of sources should be taken very seriously.

Pick a few and read a couple of pages from each. The style of presentation of the main source should be as simple and understandable as possible. The success of learning as a whole depends on this.

To understand PHP, you can use various tutorials and specialized manuals for dummies. It would be nice to add one or more sensible ones here: visualization of information significantly increases the assimilation of the material. But I repeat once again: where to start learning PHP and the choice of sources is up to you.

A little personal

In general, after the first semester, I slipped to the very bottom in terms of academic performance. And all because the teachers, seeing that most of the students “swallowed” all the material even “unchewed”, tried to give as much as possible. But I didn’t have the experience that my teammates had.

The next semester I transferred to a parallel group, consisting of the same “dummies”. For them, the teachers “cracked through” and “chewed” everything and carefully explained it. Here things started to improve, and I again became one of the best students.

I’m not bragging (well, maybe a little), but I’m trying to explain that you should choose your learning style, methods of obtaining information and the duration of mastering the discipline yourself. In my opinion, various are an ideal source of educational information. Their selection is where you need to start learning PHP from scratch.

What you need to start development

PHP is a programming language whose code is executed on the server side. Therefore, to work with it locally you need appropriate software. Three main components:

PHP interpreter.

Local server.

But installing each of these components can take a lot of time and effort. Especially if you are a beginner. The best option is to install a software package that includes all the components.

I recommend using Open Server. It includes everything you need to get started working with PHP without any headaches. The installation process is automatic (easy and fast). Just what real “dummies” need.

I hope I was able to dispel all the doubts and questions that haunt newcomers. Do you feel like you have become stronger? You've just started learning PHP. Soon you will be real “strongmen” in software sciences. Until new “trainings”!







2024 gtavrl.ru.