Please support if you like my work by payment through upi: sinhamit@icici or payment by bank
account name: Amit Kumar Sinha,
account number: 2646728782
IFSC code: KKBK0005660
SWIFT: KKBKINBB
What does PHP do ? in Category: PHP by amit
🕙 Posted on 2023-04-25 at 19:22:16 Read in Hindi ...
PHP - an Introduction
You have read in previous page, that PHP is a RUN-TIME, HIGH-Level, dynamic (loose) data type, SCRIPTing Language. PHP is designed to work on HOST SERVER, for constructing WEB-PAGES only. You have also read in previous pages, how to install TEXT / CODE Editor, and XAMPP software (necessary to run PHP). If you don't know how to start, please visit previous pages to refresh your memory.
What does exactly PHP do?
This is the first question, which you should understand before learning PHP. Many tutorials teach you everything about PHP in comprehensive or as reference, but they don't tell about this. I as a beginner, was also confused when many tutorials told me that you should first learn HTML. Then, you should learn CSS, CSS2.1, CSS3, and then JavaScript, DOM, BOM, etc. And, you should make external stylesheets, and external JavaScript files, etc.
But, today you will learn that many things are unnessarily tought, and as a WEB-DEVELOPER your thinking to innovate is narrowed to traditional way of coding.
Just think PHP as an HTML single tag/element, for example <meta />
or <link />
and you can insert data inside it. So, PHP also has opening tag and closing tag, and inside these two tags, you write CODES, programmes, etc. Just like other HTML single tag/element, PHP tags also starts with < and ends with >.
But, there is a fine difference between HTML tags and PHP tags. As you have read in previous page, that <!--
HTML comment -->
is different than other HTML elements.
Similarly, PHP opening tag consists of <?php (less-than symbol, question symbol, the word 'php' and a blank space to separate it from other codes) and PHP closing tag consists of ?> (question symbol and greater-than symbol) without any space between them. This is essential and first requirement of PHP.
Secondly, a PHP code only runs inside a file, which has .php
extension. An HTML file can have .html, .htm or similar other extensions.
Thirdly, a PHP code along with .php extension can only runs inside the PROJECT FOLDER, e.g., C:\xampp\
And finally, the apache server, MySQL service and phpMyAdmin is running either in your local computer or on host server. You should check whether these services are available and running properly, as described in previous page.
Now, you can insert data into the newly created file with .php
extension, in your project folder. This is only beginning and you will learn in later chapters that PHP can also fetch, update or delete DATA not only from your files, but also from MySQL database. This makes PHP very powerful, and it enables you to deal with large amount of DATA stored in different places.
What is DATA ?
DATA is different from DATABASE, and should not be confused between these two. To understand DATA, you should first understand how a computer (either your local PC or remote SERVER) works. A computer has various parts, such as CPU (central processing unit, generally called, PROCESSOR), Motherboard, RAM (Random Access Memory), Hard-Disk (ROM - Read Only Memory), etc.
Hard-Disk (ROM) stores all files, folders, images, videos, audios, etc. (which can be permanently stored). When a person switch ON the computer, the Processor (CPU) with the help of Motherboard, starts reading (processing) all necessary files stored in the Hard-Disk.
All these necessary files (including images, audios, videos, etc.) are converted into BINARY DATA (100111
When you don't save your work, and have closed the TEXT / CODE Editor, all these DATA will be destroyed and lost. However, modern CODE Editors, for example, VSCode may have facility to save your work in temp file, and can restore that DATA from temp file. But, simple TEXT Editor, e.g. NotePad cannot store DATA into temporary file, when you don't save your work.
Essence of above discussion is that DATA is the value stored in temporary location of your computer or remote SERVER memory. In next page, you will learn about variable and constant. These two are also DATA, that is their names are values, and something to which refer, are also DATA (binary value of characters, digits, symbols, etc.).
Leave a Comment:
Amit Sinha March 2nd, 2023 at 9:30 PM
😃 😄 😁 😆 😅 😂 😉 😊 😇 😍 😘 😚 😋 😜 😝 😶 😏 😒 😌 😔 😪 😷 😵 😎 😲 😳 😨 😰 😥 😢 😭 😱 😖 😣 😞 😓 😩 😫 😤
Ribhu March 3rd, 2023 at 9:30 PM
🐵 🐒 🐶 🐩 🐺 🐱 🐯 🐅 🐆 🐴 🐎 🐮 🐂 🐃 🐄 🐷 🐖 🐗 🐽 🐏 🐑 🐐 🐪 🐫 🐘 🐭 🐁 🐀 🐹 🐰 🐇