What and why PHP??
What and why PHP??
What is PHP?
PHP is an acronym of Hypertext Preprocessor Is widely-used as open source general-purpose scripting language that is specifically designed for web development and it can be embedded into HTML.
Explaining it a bit more now ..let us take an example :
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<?php
echo "Hi, I'm a PHP script!";
?>
</body>
</html>
1.Despite of putting various commands to output HTML (as in C ), PHP pages comprises of HTML with code which are embedded that does execution(in the above example output "Hi, I'm a PHP script!").
Recommended by LinkedIn
2.The PHP code is enclosed in special start and end processing instructions <?php and ?> it basically allows you to jump in and out of "PHP mode.
How PHP is distinguishable from client-side JavaScript ?
A code is executed on the server, generating HTML which is then forwarded further to the client. The client would fetch the results of executing that script, but is unaware of what the underlying code is. User can configure web server to execute all HTML files with PHP.
Why use PHP?
1.It is extremely simple for a new user
2.Offers many advanced funtions for a professional programmer.
3.Though PHP's development is focused on server-side scripting, users can do a lot of things with it .
4.PHP is a popular server-side scripting language . It is used to add functionality to websites that HTML can't retrieve by itself .
5.PHP can perform all types of calculations, from figuring out what day it is or what day of the week March 18, 2046, falls on, to performing all types of mathematical equations.
6.Basic math addition, subtraction, multiplication and division are done using mathematical operators. The large number of math functions are part of the PHP core. As math operations are based on operator and operands in PHP.
7.Utilizing PHP, user can directly interact with the script which is simple, for example collecting the temperature from the user that they want to convert from degrees to another format, or it can be more extensive information, like adding their information to an address book, letting them post on a forum or participate in a survey.
8.PHP is good at interacting with MySQL database. One can write user-submitted information to a database, and and can also retrieve information from the database. This allows to create pages on the fly using the contents of the database.
10. perform complex tasks like set up a login system, create a website search feature, or keep store's product catalog and inventory online.
To set up an automated picture gallery to showcase products.
11.GD Library merges up with PHP to create graphics or to edit existing graphics. Want to resize images, rotate them, change them to grayscale, or make thumbnails of them all are done with the help of PHP.
12.It also work with cookies ( Whose function is to identify a user and store the user's preferences as given on the site so the information doesn't have to be re-written each time the user visits the site) cookie are small file embedded on the user's computer.