Jawaharlal Nehru Technological University Hyderabad
Jawaharlal Nehru Technological University Hyderabad B.Tech IV PHP Programming Previous Question Paper (July - 2021 - R16)
Answer any Five Questions. All Questions Carry Equal Marks.
Main
What are the different types of operators used in PHP? Explain.
Answer
PHP supports a wide range of operators to perform operations on variables and values. The primary types include:
- Arithmetic Operators: Used for mathematical calculations such as addition (+), subtraction (-), multiplication (*), division (/), modulus (%), and exponentiation (**).
- Assignment Operators: Used to assign values to variables, such as =, +=, -=, *=, /=, and %=.
- Comparison Operators: Used to compare two values, including equal (==), identical (===), not equal (!= or <>), not identical (!==), greater than (>), less than (<), greater than or equal to (>=), and less than or equal to (<=).
- Increment/Decrement Operators: Used to increase or decrease a variable's value by one, such as pre-increment (++$a), post-increment ($a++), pre-decrement (--$a), and post-decrement ($a--).
- Logical Operators: Used to combine conditional statements, such as AND (&& or and), OR (|| or or), XOR (xor), and NOT (!).
- String Operators: Used specifically for strings, including the concatenation operator (.) and the concatenation assignment operator (.=).
- Array Operators: Used to compare arrays, such as union (+), equality (==), identity (===), inequality (!= or <>), and non-identity (!==).
- Conditional Assignment Operators: Includes the ternary operator (?:) and the null coalescing operator (??).
Explain in detail about various types of loops used in PHP.
Answer
Loops in PHP are used to execute the same block of code a specified number of times or while a condition is true. The main types are:
- while loop: Executes a block of code as long as the specified condition is true. The condition is evaluated before the execution of the loop body.
- do...while loop: Similar to the while loop, but it executes the code block once before checking the condition. This ensures the code runs at least once.
- for loop: Used when the number of iterations is known beforehand. It consists of three expressions: initialization, condition, and increment/decrement.
- foreach loop: Specifically designed for iterating over arrays. It loops through each key-value pair in an array, making it highly efficient for data processing without needing to manage index counters manually.
Explain about file handling functions in PHP.
Answer
Sign in to view the complete answer paper.
Write about, i) Parameterized function ii) Non parameterized function.
Answer
Sign in to view the complete answer paper.
Explain the steps to create and delete a file in PHP.
Answer
Sign in to view the complete answer paper.
How to read and write a file in PHP? Explain.
Answer
Sign in to view the complete answer paper.
Explain in detail file types with GD and PHP.
Answer
Sign in to view the complete answer paper.
Describe steps to create the image table.
Answer
Sign in to view the complete answer paper.
Explain MySQL commands in brief.
Answer
Sign in to view the complete answer paper.
Describe the process of working with PHP and arrays of data.
Answer
Sign in to view the complete answer paper.
Explain the relationship between Apache, MySQL and PHP.
Answer
Sign in to view the complete answer paper.
Differentiate between user defined function and systems defined function.
Answer
Sign in to view the complete answer paper.
How to pass variables between pages? Explain.
Answer
Sign in to view the complete answer paper.
Explain how to connect to the MySQL server with an example program.
Answer
Sign in to view the complete answer paper.
Write short notes on:
Exceptions
Answer
Sign in to view the complete answer paper.
Destroying cookies.
Answer
Sign in to view the complete answer paper.