Introduction to PHP
PHP is a server side programming/scripting language
PHP allows you to serve websites with processing done on the server so what do I mean by server side?
Server side processing is where PHP pages are saved on the web host, these pages can be very simple or they can be very complicated and provide functionality to a web page that far exceeds the capabilities of HTML.
So what's the difference between server side and client side?
ok so client side is where the programming elements are all loaded into the browser at the point of use so a programming language that does this would be in Javascript and it's added to the coded in a HTML page and downloaded at the time of when the visitor visits that page and any processing is done on that page in real time or real enough time and uses the visitors computer to process the functionality that.
Where server side differs is the functionality written in the PHP files is processed on the server and can take advantage of software and services installed on the server, giving the the site abilities to do high memory and processing tasks without bogging the visitors computer down.
PHP is an Open Source scripting language meaning it's free to use and it has the ability to be embedded into HTML documents (albeit with a .php extension)
Much like most programming languages PHP has open and close tags which signifies that PHP code needs to be processed within these tags.
An example of PHP code is:
So lets take a look at this
First you have the open PHP tag which tells the browser this is PHP
Second the echo command will output whatever is within the double quotes " in this case Hello World. This line as with all lines in PHP is terminated before the end PHP tag to say this is the end of the instruction, process it now.
And third the end PHP tag to say this is the end of the PHP code.
This works well when embedding php into HTML pages as you can see where the start and end of your code is. This is how I code.
This is what a typical PHP embedded HTML page looks like
As you can see indenting code regardless of HTML or PHP is a bonus as you can see what code is grouped and nested with what.
This is the introductory video in a series for PHP: Web Programming Made Easy.
The rest of the course will show you how to install a PHP environment and will teach you about the language and we will create our first dynamic website together.
online course web design start coding sql
▶️ DTube
▶️ IPFS