Introduction to PHP Programming Language
PHP is an abbreviation for Hypertext Preprocessor. Many of us know it as a scripting language. It is widely used for website development or web application development. And, PHP is also an open source programming language. What does this mean? So, the simple answer is that you can see the internal code of PHP and contribute to it.
Also, scripting language meaning is here - a program that is script-based (lines of code) written for the automation of tasks.
The core of a web application is web pages. Web pages can be created using HTML (Hypertext Markup Language). You HTML code execution is done on the client’s browser (client-side). On the other hand, the code written in PHP is executed on the server before it gets to the web browser of the user. Sounds interesting. Come, let's see with an example:
PHP is an abbreviation for Hypertext Preprocessor. Many of us know it as a scripting language. It is widely used for website development or web application development. And, PHP is also an open source programming language. What does this mean? So, the simple answer is that you can see the internal code of PHP and contribute to it.
Also, scripting language meaning is here - a program that is script-based (lines of code) written for the automation of tasks.
The core of a web application is web pages. Web pages can be created using HTML (Hypertext Markup Language). You HTML code execution is done on the client’s browser (client-side). On the other hand, the code written in PHP is executed on the server before it gets to the web browser of the user. Sounds interesting. Come, let's see with an example:
Example: An introductory example for PHP
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
</head>
<body>
<?php
echo "Hi Learners, Welcome to Engineering Capsule !";
?>
</body>
</html>
The above code is simple. All the tags are from HTML like, <html>, <head>, <body>, <title>. In the middle of the code you can see something different that is PHP. After you run this on your browser as a simple HTML file, you’ll see PHP as it is. For compiling PHP, you have to run it on your server machine.
Instead of lots of commands to output HTML (as seen in C or Perl), PHP pages contain HTML with embedded code that does "something" (in this case, output "Hi, welcome to engineering capsule!"). The PHP code is enclosed in special start and end processing instructions <?php ?> that allow you to jump into and out of "PHP mode."
Instead of lots of commands to output HTML (as seen in C or Perl), PHP pages contain HTML with embedded code that does "something" (in this case, output "Hi, welcome to engineering capsule!"). The PHP code is enclosed in special start and end processing instructions <?php ?> that allow you to jump into and out of "PHP mode."
Example: An introductory example for PHP
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
</head>
<body>
<?php
echo "Hi Learners, Welcome to Engineering Capsule !";
?>
</body>
</html>
The above code is simple. All the tags are from HTML like, <html>, <head>, <body>, <title>. In the middle of the code you can see something different that is PHP. After you run this on your browser as a simple HTML file, you’ll see PHP as it is. For compiling PHP, you have to run it on your server machine.
Instead of lots of commands to output HTML (as seen in C or Perl), PHP pages contain HTML with embedded code that does "something" (in this case, output "Hi, welcome to engineering capsule!"). The PHP code is enclosed in special start and end processing instructions <?php ?> that allow you to jump into and out of "PHP mode."
Why PHP USED?
PHP can be inserted inside HTML, and it's well suited for web development and the creation of dynamic web pages for web applications, e-commerce applications, and database applications. It's considered a friendly language with abilities to easily connect with MySQL (mostly used database with PHP), Oracle, and other databases.
It also supports most web servers including Apache and IIS. Using PHP affords web developers the freedom to choose their operating system and web server.
In PHP, server-side scripting is the main area of operation. Server-side scripting with PHP involves:
-
PHP Parser: a program that converts source or human readable code into a format easier for the computer to understand
-
Web server: a program that process files that form web pages from user requests
-
Web browser: an application used to display content from the World Wide Web
In this instance, with the use of just a PHP parser, the PHP script can be executed without a server program or browser. This use of the PHP script is normally employed for simple text processing tasks, like task schedulers.
PHP can also be used for creating client-side applications, like desktop applications. Desktop applications are usually characterized by a graphic user interface. With knowledge in using the advanced features of PHP, such as PHP-GTK, these client-side applications can be developed.
Why use a PHP framework?
A PHP framework provides a basic predefined structure (or framework) for streamlining the development of websites or web applications. Web Developers use them because they speed up the whole development process.
Above all, the responsiveness of websites and applications built using PHP frameworks helps businesses fulfill their performance needs.
PHP Parser: a program that converts source or human readable code into a format easier for the computer to understand
Web server: a program that process files that form web pages from user requests
Web browser: an application used to display content from the World Wide Web
No comments:
Post a Comment