PHP Lesson 1 – What is PHP?
PHP It is a server-side programming language. It was published in 1995 and at that time it stood for Personal Home Page (Personal Web Page). Now it stands for Hypertext Preprocessor.
Server-side worker means, HTML The process is to present the client (browser, etc.) requests of the integrated code to the client as HTML after the server processes them. The process is exactly as follows:
A request to the server with our computer (HTTP We send the request. Before the server responds to this request, we check the page on which the request is located. PHP runs the code and displays the result as a HTML It sends it to us as a page, and we display it in our browser.
Let's do our first example;
<body> <p> Hello </p> </body>
<?php tag PHP indicates the start of the codes. ?> whereas PHP indicates that the codes have ended. Echo Our code prints what is between the quotation marks on the screen. Echo When we type “World”, Hello World appears in the page preview. PHP codes are not visible. They are not visible in the page source either. Because the server PHP processes the code and HTML returns to the client as code.
PHP We can also run the codes in files with php extensions. At the same time, the server, PHP to interpret the language, PHP's must be installed.
To create a PHP workspace, you need to install PHP on your computer. Once you install PHP, you can run the code you write from the terminal. For example, you can run it with a command like "php program_dosyasi.php." However, since PHP is suitable for web use, you need to set up a web server to display web pages. I recommend installing XAMPP for Windows. You can find many installation resources online. If you're using a Linux distribution like Ubuntu, lamp installation on ubuntu You can read my article.
[…], I realized this while learning Node.js. My native language was PHP, and I had spent years coding in a synchronous world. The asynchronous nature of Node.js […]