Page 171 - CITS - Computer Software Application -TT
P. 171
COMPUTER SOFTWARE APPLICATION - CITS
6 Integration with Other Technologies:
• PHP can be easily integrated with other technologies like HTML, CSS, JavaScript, and various web servers.
7 Extensive Community Support:
• PHP has a large and active community of developers who contribute to its growth, providing support,
resources, and a rich ecosystem of libraries and frameworks.
These features make PHP a powerful and versatile language for building dynamic and interactive web
applications.
Basic PHP Syntax, tags, Data types, Constants
and Variables, Operators and expressions
Getting Started with PHP
Basic PHP Syntax & Tags
PHP is a server-side scripting language, meaning that PHP scripts are executed on the server before the results
are sent back to the browser as plain HTML. Understanding the basic syntax is crucial for effective PHP coding.
Placing PHP Script: A PHP script can be placed anywhere in the HTML document. It starts with <?php and ends
with ?>. The default file extension for PHP files is “.php”.
Example PHP File: A typical PHP file contains a mix of HTML and PHP scripting code. Below is an example of a
simple PHP file that outputs “Hello World!” using the built-in PHP function
echo
Note that PHP statements end with a semicolon (;).
PHP Case Sensitivity: PHP keywords, classes, functions, and user-defined functions are not case-sensitive.
However, variable names are case-sensitive. In the example below, various case variations of the echo keyword
are considered equal and legal.
Note: Variable names, on the other hand, must be used consistently with their defined case.
Data Types in PHP
Variables can store data of different types, and different data types can do different things.
PHP supports the following data types:
• String
• Integer
• Float (floating point numbers - also called double)
158
CITS : IT&ITES - Computer Software Application - Lesson 47 - 62