#### 12th Standard Computer Applications PHP Function and Array English Medium Free Online Test One Mark Questions 2020 - 2021

12th Standard

Reg.No. :
•
•
•
•
•
•

Computer Applications

Time : 00:10:00 Hrs
Total Marks : 10

10 x 1 = 10
1. A function in PHP which starts with _________ (double underscore) is know as...

(a)

Magic Function

(b)

Inbuilt Function

(c)

Default Function

(d)

User Defined Function

2. PHP’s numerically indexed array begin with position ___________

(a)

1

(b)

2

(c)

0

(d)

-1

3. Which of the following are correct ways of creating an array?
ii) state[] = array(“Tamilnadu”);
iii) state[0] = “Tamilnadu”;
iv) state = array(“Tamilnadu”);

(a)

iii) and iv)

(b)

ii) and iii)

(c)

Only i)

(d)

ii), iii) and iv)

4. What will be the output of the following PHP code?
< ?php
a=array(“A”,”Cat”,”Dog”,”A”,”Dog”);
b=array(“A”,”A”,”Cat”,”A”,”Tiger”);
c=array_combine(a,b);
print_r(array_count_values(c));
? >

(a)

Array ( [A] = > 5 [Cat] = > 2 [Dog] = > 2 [Tiger] = > 1 )

(b)

Array ( [A] = > 2 [Cat] = > 2 [Dog] = > 1 [Tiger] = > 1 )

(c)

Array ( [A] = > 6 [Cat] = > 1 [Dog] = > 2 [Tiger] = > 1 )

(d)

None of these

5. For finding nonempty elements in array we use

(a)

is_array ( ) function

(b)

sizeof ( ) function

(c)

array_count ( ) function

(d)

array_count ( ) function

6. PHP arrays are also called as

(a)

Vector arrays

(b)

Perl arrays

(c)

Hashes

(d)

All of them

7. What functions count elements in an array?

(a)

count

(b)

Sizeof

(c)

Array_Coun

(d)

Count_array

8. A Function is a type of___________.

(a)

sub routine

(b)

procedure

(c)

Either a or b

(d)

None of these

9. _________ is a concept that stores more than one value of same data type in single array variable.

(a)

Arrays

(b)

Segments

(c)

Functions

(d)

All of these

10. __________ arrays are a key-value pair data structure.

(a)

Associative

(b)

Indexed

(c)

Multi-dimensional

(d)

All of these