0% found this document useful (0 votes)
9 views4 pages

PHP Important Notes With Diagram Unit II

The document provides important notes on PHP, covering its introduction, features, syntax, variables, data types, operators, control structures, functions, constants, arrays, and variable handling functions. PHP is a server-side scripting language used for dynamic web development and supports various functionalities like form handling and database integration. Key concepts include variable scope, types of arrays, and the use of built-in and user-defined functions.

Uploaded by

asmalubnashaikh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

PHP Important Notes With Diagram Unit II

The document provides important notes on PHP, covering its introduction, features, syntax, variables, data types, operators, control structures, functions, constants, arrays, and variable handling functions. PHP is a server-side scripting language used for dynamic web development and supports various functionalities like form handling and database integration. Key concepts include variable scope, types of arrays, and the use of built-in and user-defined functions.

Uploaded by

asmalubnashaikh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

PHP Important Exam Notes - OSWAD Unit II

1. Introduction to PHP

PHP (Hypertext Preprocessor) is a server-side scripting language used to develop dynamic and interactive

web pages. PHP code is embedded in HTML and runs on the server.

2. Features of PHP

- Cross-platform support

- Integrates with Apache, IIS

- Handles forms, file systems, databases

- Powers forums, blogs, CMS, eCommerce apps

3. PHP Syntax and Comments

PHP code starts with <?php and ends with ?>

Single-line comments: // or #

Multi-line comments: /* comment */

4. Variables and Scope

- Variables start with $ (e.g., $x)

- Loosely typed (no data type declaration)

- Scope: local, global, static

5. Data Types

Scalar: boolean, integer, float, string


PHP Important Exam Notes - OSWAD Unit II

Compound: array, object

Special: NULL, resource

6. Operators

Arithmetic, Assignment, Comparison, Logical, String, Array, Conditional

7. Control Structures

Conditionals: if, else, elseif, switch

Loops: for, while, do...while, foreach


PHP Important Exam Notes - OSWAD Unit II
PHP Important Exam Notes - OSWAD Unit II

Flowchart: Loop Execution

8. Functions

Functions help reuse code. PHP supports built-in and user-defined functions.

Supports parameters, return values, default arguments, recursion, call by value/reference.

9. Constants

Constants are defined using define(). Their value cannot be changed.

Example: define("PI", 3.14);

10. Arrays

Types: Indexed, Associative, Multidimensional

Use foreach to traverse arrays.

11. Variable Handling Functions

Examples: isset(), empty(), is_array(), gettype(), var_dump(), etc.

Used to inspect and manage variables.

You might also like