PHP
Hypertext Preprocessor (PHP)
LECTURE 2
ENG: ALI AL-OBAL
2024-2025
Review
Frontend (client Side) and Backend (Server Side) Design
PHP Hypertext Preprocessor (PHP)
(PHP) is a programming language that allows web
developers to create dynamic content that interacts with
databases.
PHP is basically used for developing web based software
applications.
What is PHP?
PHP is an acronym for "PHP: Hypertext Preprocessor"
PHP is a widely-used, open source scripting language
PHP scripts are executed on the server
PHP is free to download and use
What is a PHP file?
PHP files can contain text, HTML, CSS, JavaScript, and PHP code
PHP code is executed on the server, and the result is returned to the
browser as plain HTML
PHP files have extension ".php"
What Can PHP Do?
PHP can generate dynamic page content
PHP can create, open, read, write, delete, and close files on the server
PHP can collect form data
PHP can send and receive cookies
PHP can add, delete, modify data in your database
PHP can be used to control user-access
PHP can encrypt data
With PHP you are not limited to output HTML.You can output images or PDF
files. You can also output any text, such as XHTML and XML.
Why PHP?
PHP runs on various platforms (Windows, Linux, Unix, Mac, etc.)
PHP is compatible with almost all servers used today (Apache, IIS, etc.)
PHP supports a wide range of databases
PHP is easy to learn and runs efficiently on the server side
Characteristics of PHP
Five important characteristics make
PHP's practical nature possible −
Simplicity
Efficiency
Security
Flexibility
Familiarity
Basic PHP Syntax
PHP Case Sensitivity
PHP Comments
Variable Names
Variables are "containers" for storing information.
http://php.net/manual/en/language.variables.basics.
php
Output Variables
Variable Types
PHP supports the following data types:
String
Integer
Float (floating point numbers - also called double)
Boolean
Array
Object
NULL
Resource
PHP Variables Scope
In PHP, variables can be declared anywhere in the script.
PHP echo and print Statements
double quotes
Single quotes