PHP started out as a small open source project that grew as more and more people found out how useful it was. In 1994, Rasmus Lerdorf put out the first version of PHP.
- PHP stands for “PHP: Hypertext Preprocessor,” which is also an acronym.
- PHP is a scripting language that runs on the server. It is built into HTML. It is used to manage dynamic content, databases, session tracking, and even to build whole e-commerce sites.
- It works with MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server, among other popular databases.
- PHP runs quickly, especially when it is compiled as an Apache module on a Unix system. Once the MySQL server is running, it can run even very complicated queries with very large sets of results in record time.
- PHP works with a lot of important protocols, like POP3, IMAP, and LDAP. PHP4 made n-tier development possible for the first time by adding support for Java and distributed object architectures (COM and CORBA).
- PHP is forgiving. The PHP language tries to be as forgiving as possible.
- PHP Syntax is C-Like.
PHP is often used to…
- PHP works with the system, so it can create, open, read, write, and close files on a system.
- PHP can handle forms, which means it can get data from files, save data to files, send data via email, and give data back to the user.
- Using PHP, you can add, delete, and change things in your database.
- You can look at the cookie variables and set cookies.
- Using PHP, you can make it so that only certain people can see certain pages of your website.
- It can hide information.
What PHP is and what it does
PHP is useful because of five things that make it possible. −
- Simplicity
- Efficiency
- Familiarity
- Security and adaptability
“Hello Coder” PHP Script
Start with simple PHP scripts to get a feel for the language. “Hello, Coder!” is a very important example, so we’ll start by making a friendly “Hello, Coder!” script.
As was already said, PHP is built into HTML. That means that in addition to your normal HTML (or XHTML, if you’re up-to-date), you’ll have PHP statements like this
<html>
“Hello Coder” is written in the header.
<body>
<?php echo “Hello, Coder!”;
?></body>
</html>
It will lead to the following result:
Hello, Coder!
If you look at the above example’s HTML output, you’ll see that the PHP code is not in the file that your server sends to your Web browser. All of the PHP that is on the Web page is processed and stripped from the page. The Web server only sends HTML output back to the client.
All PHP code must be put inside one of three special markup tags that the PHP Parser can understand.
Here’s where the PHP code goes:
<?php PHP code goes here ?>
<script language = “php”> PHP code goes here </script>
The?PHP … ?> tag is very common, and we will also use it in this tutorial.
From the coming blog, we’ll start with setting up PHP on your computer, and then we’ll dig into almost every PHP concept to help you get used to the language.