0% found this document useful (0 votes)
22 views

PHP1

Notes of php programming language

Uploaded by

suryanarayansu07
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

PHP1

Notes of php programming language

Uploaded by

suryanarayansu07
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

PHP

PHP is an open-source, interpreted, and object-oriented scripting


language that can be executed at the server-side.

PHP is well suited for web development. Therefore, it is used to


develop web applications (an application that executes on the
server and generates the dynamic page.).

PHP was created by Rasmus Lerdorf in 1994 but appeared in the


market in 1995. PHP 7.4.0 is the latest version of PHP, which was
released on 28 November.

What is a Scripting Language?


A script is a set of programming instructions that is interpreted at
runtime.

A scripting language is a language that interprets scripts at


runtime. Scripts are usually embedded into other software
environments.

The purpose of the scripts is usually to enhance the performance


or perform routine tasks for an application.

Server side scripts are interpreted on the server while client side
scripts are interpreted by the client application.

PHP is a server side script that is interpreted on the server while


JavaScript is an example of a client side script that is interpreted
by the client browser. Both PHP and JavaScript can be embedded
into HTML pages.

Programming Language Vs Scripting Language


Programming language Scripting language
Has all the features needed to
Mostly used for routine tasks
develop complete applications.
The code has to be compiled The code is usually executed
before it can be executed without compiling
Does not need to be embedded Is usually embedded into other
into other languages software environments.
What does PHP stand for?
PHP means – Personal Home Page, but it now stands for the
recursive backronym PHP: Hypertext Preprocessor.

PHP code may be embedded into HTML code, or it can be used in


combination with various web template systems, web content
management system and web frameworks.

Some important points need to be noticed about PHP are as


followed:

o PHP stands for Hypertext Preprocessor.


o PHP is an interpreted language, i.e., there is no need for
compilation.
o PHP is faster than other scripting languages, for example,
ASP and JSP.
o PHP is a server-side scripting language, which is used to
manage the dynamic content of the website.
o PHP can be embedded into HTML.
o PHP is an object-oriented language.
o PHP is an open-source scripting language.
o PHP is simple and easy to learn language.

Why use PHP

PHP is a server-side scripting language, which is used to design


the dynamic web applications with MySQL database.

o It handles dynamic content, database as well as session


tracking for the website.
o You can create sessions in PHP.
o It can access cookies variable and also set cookies.
o It helps to encrypt the data and apply validation.
o PHP supports several protocols such as HTTP, POP3,
SNMP, LDAP, IMAP, and many more.
o Using PHP language, you can control the user to access
some pages of your website.
o As PHP is easy to install and set up, this is the main reason
why PHP is the best language to learn.
o PHP can handle the forms, such as - collect the data from
users using forms, save it into the database, and return
useful information to the user. For example - Registration
form.

PHP Features

PHP is very popular language because of its simplicity and open


source. There are some important features of PHP given below:

Performance:

PHP script is executed much faster than those scripts which are
written in other languages such as JSP and ASP. PHP uses its
own memory, so the server workload and loading time is
automatically reduced, which results in faster processing speed
and better performance.

Open Source:

PHP source code and software are freely available on the web.
You can develop all the versions of PHP according to your
requirement without paying any cost. All its components are free to
download and use.

Familiarity with syntax:

PHP has easily understandable syntax. Programmers are


comfortable coding with it.

Embedded:

PHP code can be easily embedded within HTML tags and script.

Platform Independent:

PHP is available for WINDOWS, MAC, LINUX & UNIX operating


system. A PHP application developed in one OS can be easily
executed in other OS also.

Database Support:
PHP supports all the leading databases such as MySQL, SQLite,
ODBC, etc.

Error Reporting -

PHP has predefined error reporting constants to generate an error


notice or warning at runtime. E.g., E_ERROR, E_WARNING,
E_STRICT, E_PARSE.

Loosely Typed Language:

PHP allows us to use a variable without declaring its datatype. It


will be taken automatically at the time of execution based on the
type of data it contains on its value.

Web servers Support:

PHP is compatible with almost all local servers used today like
Apache, Netscape, Microsoft IIS, etc.

Security:

PHP is a secure language to develop the website. It consists of


multiple layers of security to prevent threads and malicious
attacks.

Control:

Different programming languages require long script or code,


whereas PHP can do the same work in a few lines of code. It has
maximum control over the websites like you can make changes
easily whenever you want.

A Helpful PHP Community:

It has a large community of developers who regularly updates


documentation, tutorials, online help, and FAQs. Learning PHP
from the communities is one of the significant benefits.

Web Development

PHP is widely used in web development nowadays. PHP can


develop dynamic websites easily. But you must have the basic the
knowledge of following technologies for web development as well.
o HTML
o CSS
o JavaScript
o Ajax
o XML and JSON
o jQuery

Prerequisite

Before learning PHP, you must have the basic knowledge


of HTML, CSS, and JavaScript. So, learn these technologies for
better implementation of PHP.

HTML - HTML is used to design static webpage.

CSS - CSS helps to make the webpage content more effective and
attractive.

JavaScript - JavaScript is used to design an interactive website.

1. Web Development career


Primarily, PHP’s future scope resides in web development. They
are responsible for designing, creating, and maintaining the
websites and applications for the Internet. PHP with a database
can create interactive and dynamic websites and applications.

2. Database administers
Database administers deals with organizing and managing the
data. PHP makes database management convenient. Using PHP,
you can connect to and manipulate databases. The server-side
language, PHP allows you to interact with the databases. PHP is
conveniently used for creating database management systems.

3. Graphic design using dream weaver


Graphic designers are responsible for creating attractive visuals
digitally. The Adobe Dreamweaver helps graphic designers create
eye-catching and attractive graphics for internet content.

Skills to Expand Your PHP Developer Career Path

1. CSS
PHP is a server-side language. Hence, it requires a stylesheet
language to make the websites dynamic. With the skills of CSS, a
PHP developer can create interactive and user-friendly websites.

2. Javascript
JavaScript is a client-side scripting language. With the knowledge
of Javascript, a PHP developer can conveniently operate on both
client-side and server-side instructions.

3. Word press
Word press is another significant skill in PHP’s future scope.
WordPress uses PHP to interact with the database and search the
required data. The action on your webpage is decided by the PHP
tags provided by WordPress.

PHP Features And Facts

Apart from having several job opportunities at the moment, you


can rest assured about your future as a PHP developer. Following
points highlight the promising future of PHP:

1. Visibility over internet


PHP is the most popular language for millions of websites like
Wikipedia, tumblr, etc. If you go online and randomly select some
websites, you will find many websites with a .php extension.

2. PHP in blogging
Since PHP is simple to learn and easy to adopt, it is widely used in
blogging websites like WordPress.

3. CMS (Content management system Software)supporting


PHP
With the support of CMS, publishing a website can be done quickly
and easily in PHP.

4. PHP and MySQL


For server-based web applications using a database, MySQL can
be used with PHP. Database support through MySQL can be
adopted easily by even non-technical developers.

5. Simplicity of PHP
The simplicity of PHP has contributed to its immense popularity
and assures its presence in the future over other complex
languages.

6. Regular updates in PHP


New frameworks are continuously being added in PHP to keep it
feature rich and up-to-date with the latest technologies.

What is XAMPP?
XAMPP is an open-source, cross-platform web server that
consists of a web server, MySQL database engine, and PHP
and Perl programming packages. It is compiled and maintained by
Apache. It allows users to create WordPress websites online using
a local web server on their computer. It supports Windows, Linux,
and Mac.
It is compiled and maintained by apache. The acronym XAMPP
stands for;

 X – [cross platform operating systems] meaning it can run on


any OS Mac OX , Windows , Linux etc.
 A – Apache – this is the web server software.
 M – MySQL – Database.
 P – PHP
 P – Perl – scripting language

How to Install XAMPP


We look into step by step process to install XAMPP for Windows.
For Other Operating Systems, XAMPP installation steps are
similar.

Step 1) Download XAMPP

Click here to XAMPP download for


Windows: https://www.apachefriends.org/download.html

Step 2) Start Installation

XAMPP Installation is just like installing any other windows


program. There are however, a few things that we must note.
Step 3) Run the Setup

After you have downloaded XAMPP, run the setup. The warning
message dialog window shown below appears.

You might also like