Web Technology II/ PHP Class 12
Introduction of PHP
PHP is one of the most widely used server-side scripting languages for web development. Popular websites like Facebook, Yahoo, Wikipedia, etc, and our very own Study tonight, are developed using PHP.
PHP is so popular because it's very simple to learn, code and deploy on the server, hence it has been the first choice for beginners for decades.
What is PHP?
PHP stands for Hypertext Pre-Processor. PHP is a scripting language used to develop static and dynamic web pages and web applications. Here are a few important things you must know about PHP:
-> PHP is an Interpreted language, hence it doesn't need a compiler.
-> To run and execute PHP code, we need a Web server on which PHP must be installed.
-> PHP is a server-side scripting language, which means that PHP is executed on the server and the result is sent to the browser in plain HTML.
-> PHP is open-source and free.
Features of PHP
PHP is open source and free, hence you can freely download, install and start developing using it.
PHP has a very simple and easy-to-understand syntax, hence the learning curve is smaller as compared to other scripting languages like JSP, ASP, etc.
PHP is cross-platform, hence you can easily develop and move/deploy your PHP code/project to almost all the major operating systems like Windows, Linux, Mac OSX, etc.
All the popular web hosting services support PHP. Also, the web hosting plans for PHP are generally amongst the cheapest plans because of their popularity.
Popular Content Management Systems like Joomla, Drupal, etc are developed in PHP and if you want to start your own website like Study tonight, you can easily do that with PHP.
With PHP, you can create static and dynamic webpages, perform file handling operations, send emails, access and modify browser cookies, and almost everything else that you might want to implement in your web project.
PHP is fast compared to other scripting languages like JSP and ASP.
PHP has in-built support for MySQL, which is one of the most widely used Database management systems.
Uses of PHP
It can be used to create Web applications like Social Networks(Facebook, Digg), Blogs(WordPress, Joomla), eCommerce websites(OpenCart, Magento, etc.), etc.
Command Line Scripting. You can write PHP scripts to perform different operations on any machine, all you need is a PHP parser for this.
Create Facebook applications and easily integrate Facebook plugins into your website, using Facebook's PHP SDK. Check this link for more information.
Sending Emails or building email applications because PHP provides a robust email-sending function.
WordPress is one of the most used blogging(CMS) platforms in the World, and if you know PHP, you can try a hand at WordPress plugin development.
Implementing PHP with HTML
When it comes to integrating PHP code with HTML content, you need to enclose the PHP code with the PHP start tag <? PHP and the PHP end tag ?>. The code wrapped between these two tags is considered to be PHP code, and thus it'll be executed on the server side before the requested file is sent to the client browser.
<html>
<head>
<title>Embed PHP in a .html File</title>
</head>
<body>
<h1><?php echo "Hello World" ?></h1>
</body>
</html>
Netra Koirala
Computer Science Educator
Passionate computer science educator and author. Provides free study notes, practical guides, and tutorials for Class 9, 10, 11, 12, and B.Sc CSIT students in Nepal. Years of teaching experience in computer science fundamentals.
LinkedIn ProfileRelated Posts
Loading related posts…
Computer Science notes, tutorials, MCQs, and educational resources for Nepal students. Covering Class 9, SEE preparation, Class 11, Class 12, SLC, programming, DBMS, networking, HTML, JavaScript, PHP, OOP and more.
Featured Post
Grade 10 Computer Science: Specification Grid & Model Questions
Specification Grid & Model Questions of Computer Science | Grade 10 📚 Examination Resource Specification Grid & M...
