PHP Tutorial

PHP stands for Hypertext Pre-processor. Php is a server-side scripting language. It is basically used for website development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1994;

Syntax:-


<?php 

?>

Try it on PHP Editor
if short tag is enable in php.ini file

Syntax:-


<?

?>

Example:-


<?php
echo 'Hello Friends';
?>
Output:- Hello Friends

PHP Advantage

1) Easy to read and write code.
2) It is supported by a majority of Operating Systems like Solaris, UNIX, Windows, and Linux.
3) Easy database connectivity.
4) It is an Open source so there is no need to pay anything.

Important Framework:- There are lots of PHP framework famous in the market like Laravel, Codeigniter, CakePHP, Zend, Symphony, etc.

Important CMS:- There are lots of PHP CMS in the market.

Ecommerce CMS:- There are lots of E-commerce CMS in the Market But Magento is more famous than other

Blogging CMS:- WordPress is most famous in the world, there are 70% website used this CMS on the web.

Some Important website which is developed in PHP

1) Facebook
2) Wikipedia
3) Yahoo
4) Tumblr
5) WordPress
6) MailChimp
7) Flickr

PHP Tutorial – Questions and Answers

Q 1: What is PHP?

Ans: PHP (Hypertext Preprocessor) is a server-side scripting language used to create dynamic and interactive web pages.

Q 2: Where is PHP executed?

Ans: PHP code is executed on the web server, and the result is sent to the browser as HTML.

Q 3: Is PHP an open-source language?

Ans: Yes, PHP is open-source and free to use.

Q 4: What are common uses of PHP?

Ans: PHP is used for web development, form handling, database interaction, and session management.

Q 5: Can PHP work with databases?

Ans: Yes, PHP supports many databases like MySQL, PostgreSQL, and SQLite.

PHP Tutorial – Objective Questions (MCQs)

Q1. PHP stands for ______.






Q2. PHP is a ______ side scripting language.






Q3. Which file extension is used for PHP files?






Q4. PHP code is enclosed within ______.






Q5. PHP scripts can run on ______.






Related PHP Tutorial Topics