In this tutorial, I will explain how to code with PHP, starting with PHP basics as well as connecting to databases and building dynamic web pages.
This is the first Tutorial in this Course. I will share a brief definition of PHP and why it’s a good choice to learn. As well as how to install PHP in your machine and get everything ready to GO!.
What is PHP Programing Language?
Php stands for “Hypertext Preprocessor” it’s an Open-source Programming/scripting language. inspired by Rasmus Lerdorf in 1994.
It’s a widely-used web development language. Php is a server-side and to be precise it’s a scripting language: meaning it’s not a programming language. the main difference is it uses an interpreter instead of a compiler.
- PHP is Open source
- Server-side, requires a server: Apache.
- PHP creates dynamic web pages by interacting with the database.
- PHP is a scripting language.
- Cross-platform (Linux, Windows, Mac…)
- Easy and powerful.
Difference between Script and Program
A scripting language executes code line by line, and programming uses an interpreter that compiles the hall code at once and then executes it. Moreover, there are other scripting languages like: (Python, PHP, Javascript..). in the other hand, some major programming language is (C, C++, C#, JAVA ..) . In fact the there is no big difference between interpreted and compiled language, but we can say that scripting languages are more efficient and efficient, and practical.
How PHP works
Php is a server-side / Backend scripting language, which means when a user sends a request to the server the server executes PHP code. Then it returns an HTML page. That means Php is used to create dynamic web pages with the help of a database.
If you are wondering what differs between PHP over Javascript? Well, Java script is a frontend language, which means a client-side (Your Browser). Javascript does need a server to be executed.
- PHP can be executed by a server ex: Apache.
- PH interacts with databases ex: Mysql.
- The server generates a dynamic Html web page and resends them to the user.
- Php files ends with .php extension.
How to install PHP in Windows 10
Installing PHP requires installing Apache server, and MySQL, MariaDB. and the best way to do this is by installing a full package server like Xampp. so we recommend installing the Xampp server. This can be done by following this video:
Now if you Install Xampp you can start coding by following the next lesson on the course. Php Syntax.