Unit 3 PHP
Unit 3 PHP
PHP
What is PHP?
• PHP is an acronym for "PHP: Hypertext
Preprocessor"
• PHP is a widely-used, scripting language and a
powerful tool for making interactive and
dynamic web pages.
• 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 add, delete, modify data in your
database
• PHP can be used to control user-access
• PHP can encrypt data
**PHP Syntax/Structure of PHP
• A PHP script can be placed anywhere in the
document.
• A PHP script starts with <?php and ends with ?>
Example
PHP for Loop
• Syntax