MQP1
MQP1
Section-A
I. Answer any Four questions. Each question carries Two marks (4X2=8)
Define WWW or The Web..
Both echo and print are used to output data in PHP, but they have
some differences. echo can handle multiple parameters and does not
have a return value, making it more versatile for outputting content.
On the other hand, print can only take one argument and always
returns 1, which makes it suitable for use in expressions. Additionally,
echo does not require parentheses, while print can be used with or
without them.
How to define a function in PHP?
Section-B
II. Answer any Four question. Each question carries Five marks (4x5=20)
What is Web Server? Explain the Functions of Web Server.
Web Server:
A web server is a software application or hardware device that
processes and serves client requests over the internet. It hosts
websites and web applications, handling requests from browsers and
delivering the requested content, which may include HTML pages,
images, stylesheets, and other resources.
1. Request Handling:
2. Content Storage:
4. Security:
6. Load Balancing:
7. Caching:
1. Capturing Phase:
• Definition: During the capturing phase, the event moves from the
root of the document hierarchy down to the target element.
• Event Flow Path: window -> document -> html -> ... -> parent
-> target
2. Bubbling Phase:
• Definition: During the bubbling phase, the event moves from the
target element back up to the root of the document hierarchy.
• Event Flow Path: target -> parent -> ... -> html -> document
-> window
In this modified example, clicking the button will log "Bubbling phase
- Target," but it won't reach the parent element due to the use of
stopPropagation() .
Explain Variable Typing (Dynamic Type Casting in PHP) with examples.
• Example:
2. array_pop($array)
• Example:
• Example:
4. array_keys($array)
• Example:
5. array_values($array)
• Example:
Explain SAX and DOM Parsers. What are the main differences of SAX
and DOM?
Functionality:
Example:
xmlCopy code <book> <title>Harry Potter</title> <author>J.K.
Rowling</author> </book>
Events:
• Start Document
• End Document
Functionality:
Example:
DOM Tree:
2. Processing Approach:
3. Performance:
4. Use Cases:
Key Features:
1. Event Flow:
2. Event Types:
3. Event Listeners:
4. Event Object:
6. Custom Events:
Operators in PHP:
1. Arithmetic Operators:
2. Comparison Operators:
3. Logical Operators:
4. Assignment Operators:
5. Concatenation Operator:
phpCopy code $str1 = "Hello"; $str2 = "World"; $concaten
ated = $str1 . $str2; // Concatenation
If Statement:
If-Else Statement:
Elseif Statement:
Nested If Statement:
Switch Statement:
Array Functions:
Explain the process of reading from and writing to files in PHP with an
example code.
Writing to a File:
1. Simple Types:
Definition:
• Simple Types define the data type of a single XML element, and
they represent atomic values.
they represent atomic values.
Examples:
1. xs:string (String):
2. xs:integer (Integer):
3. xs:date (Date):
4. xs:boolean (Boolean):
2. Complex Types:
2. Complex Types:
Definition:
• They allow for nested structures and represent more complex data
hierarchies.
Examples:
This defines a complex type for the "book" element with a simple
content model. It can have a text value and an "isbn" attribute.