0% found this document useful (0 votes)
877 views6 pages

PHP Exam Past Paper

This document contains questions about PHP for an exam. It covers topics like PHP characteristics, flow control structures, arrays, data types, variables vs constants, variable scope, sessions vs cookies, file inclusion, break and continue statements, functions for sorting arrays, GET vs POST methods, static vs dynamic websites, and developing PHP scripts to perform tasks like calculating averages, printing patterns, factorials, sorting arrays, finding minimum/maximum values, and creating a login form.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
877 views6 pages

PHP Exam Past Paper

This document contains questions about PHP for an exam. It covers topics like PHP characteristics, flow control structures, arrays, data types, variables vs constants, variable scope, sessions vs cookies, file inclusion, break and continue statements, functions for sorting arrays, GET vs POST methods, static vs dynamic websites, and developing PHP scripts to perform tasks like calculating averages, printing patterns, factorials, sorting arrays, finding minimum/maximum values, and creating a login form.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

PHP QUESTIONS

SECTION A: ATTEMPT ALL QUESTIONS/55 MARKS


1. What are the characteristics of php/3
2. Explain the components of flow control structures in php/3
3. What is an array? Outline the types of arrays in php/4
4. Why use php/4
5. What are the types of data type in php/4
6. Tell us the difference between a variable and a a constant/4
7. What is the scope of variable in php/3
8. What are the differences btn session and cookie/2
9. What are the ways to include file in php/2
10. What are the meanings of break and continue statements in php/2
11. What will be the output of the following code/2
<?php
$x=10;
$y=$x--;
echo $y;
?>
12. How can you create a session in php/4
13. How can you make a connection with my sql using php/4
14. What are the differences between Var_dump and print_r functions/2
15. What are the advantages of using php functions /4
16. What is the difference btn get and post method/4
17. What is the difference btn static and dynamic websites/2

SECTION B: CHOOSE ANY THREE QUESTIONS/30

18. A. Develop a php script to record 10 marks of the students in array then compute its
average and first five lowest marks of students.
B. Develop a php script the below pattern

*****
* *
* *
* *
***** /10

19. A. Develop a php program to print the factorial of anumber


B. Develop a php program to print the below format
12345678
1234567
123456
12345
1234
123
12
1
20. A. Discuss on the following different functions used in sorting an array? asort(), ksort(),
sort() and rsort()
B. Develop a php program to print the below stars format
*
**
***
****
*****
******
*******
********
*********

21. A. Develop a php program for finding the biggest number in an array without using any
array functions. Hint: $numbers = array(12,23,45,20,5,6,34,17,9,56,999);
B. Develop a php program for finding the smallest number in an array
Hint:$numbers= array(12,23,45,20,5,6,34,17,9,56);
22. . Develop a php program to print the following table
SECTION C: CHOOSE ANY ONE QUESTION/15
23. Develop a php program to allow the user to enter any number into user form then
produce the multiplication table of that entered number. Hint :

24.Suppose you have given the user login interface, homepage. Php, write a php script for
crating the below login page and validate the user’s credentials by using Exam as username and
Exam@2023 as password then when the user clicks on login button the logged user to
homepage. Php

You might also like