Question 1
Which of the following function is used to get length of a string?

A)None of the above.
B)strlen()
Csize()
C)length()

Question 2
$Var = substr("abcdef", -4, 1);
The above statement will print.

A)returns "cd"
B)returns "f"
C)returns "d"
D)returns "c"

Question 3
Which PHP function is use to delete a file in PHP ?

A)rmdir
B)remove
C)unlink
D)rename

Question 4
How do you create an array in PHP?

A)$cars = "Volvo", "BMW", "Toyota";
B)$cars = array("Volvo", "BMW", "Toyota");
C)$cars = array{"Volvo", "BMW", "Toyota"};
D)$cars = array["Volvo", "BMW", "Toyota"];


Question 5
What result will below code print ?


$calculate = 18 + 018 + 0x18;

echo "$calculate";


A)36
B)43
C)54
D)18

Question 6
Who is Father of PHP ?


A)ames Gosling
B)Larry Wall
C)Guido Van Rossum
D)Rasmus Lerdorf

Question 7
All variables in PHP start with which symbol?


A)@
B)#
C)&
D)$

Question 8
. . . . . converts the keys of an array into values and the values into keys in PHP.

A)array_flip()
B)array_transpose()
C)array_flips()
D)array_trans()

Question 9
Which of the following function sorts an array in reverse order?

A)rsort()
B)shuffle()
C)sort()
D)reset()

Question 10
Which of the following function is used for terminate the script execution in PHP?

A)quit()
B)break()
C)die()

Question 11
How do you get information from a form that is submitted using the "get" method?
A)$_GET[];
B)Request.Form;
C)$_POST[];
D) Request.QueryString;

Question 12
Which of the following function is used to locate a string within a string?

A)search()
B)locate()
C)None of the above.
D)strpos()

Question 13
Which of the following is correct about preg_match() function?

A)The preg_match() function searches a string specified by string for a string specified by pattern, returning true if the pattern is found, and false otherwise.
B)The preg_match() function searches throughout a string specified by pattern for a string specified by string. The search is not case sensitive.
C)None of the above
D)The preg_match() function searches string for pattern, returning true if pattern exists, and false otherwise.

Question 14
In PHP while using the POST method to submit form, variables are displayed in the URL ?

A)False
B)True

Question 15
Which of the following function is used to pick one or more random values from PHP Array?

A)Rand_array()
B)array_random()
C)Random_array()
D)array_rand()

Question 16
In PHP, the only way to output text is with echo.

A)FALSE
B)TRUE

Question 17
Below code will print ?


$a = 1;

{
  $a = 2;
}

echo $a, "\n";

A)1
B)2
C)Null
D)Syntax Error will Occur

Question 18
Which of the following is used to access session variables in PHP?

A)isset() function
B)session_start() function
C)session_destroy() function
D)$_SESSION[]

Question 19
Which of the following function is used to read the content of a file?

A)file_exist()
B)filesize()
C)fread()
D)fopen()

Question 20
Which of the following is NOT a valid PHP comparison operator?

A)!=
B)<=>
C)<>
D)===
E)>=

Question 21
Which of the following type of variables have only two possible values either true or false?

A)Booleans
B)Doubles
C)Strings
D)Integers

Question 22
Is PHP case sensitive?

A)False
B)True

Question 23
What will be the output of the following code? If say date is 26/10/2016.


echo "Today is ".date("F d, Y");

A)Today is October 26, 2016
B)Today is 10-26-2016
C)Today is 2016 October, 26
D)Today is 26 October, 2016
E)None of the above

Question 24
Which of the following provides the actual name of the uploaded file?

A)$_FILES['file']['tmp_name']
B)$_FILES['file']['name']
C)$_FILES['file']['size']
D)$_FILES['file']['type']

Question 25
session_destroy() erases all session variable.

A)TRUE
B)FALSE

Question 26
In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:

A)TRUE
B)FALSE

Question 27
Which of the following function checks if a specified value exists in an array?

A)extract()
B)krsort()
C)in_array()
D)key()

Question 28
How do you define a constant in PHP ?

A)define MY_CONSTANT = "value";
B)set(MY_CONSTANT, "value");
C)set MY_CONSTANT=value;
D)define("MY_CONSTANT", "value");

Question 29
What are the standard (preferred/safest) opening and closing php tags ?

A)<? ?>
B)<% %>
C)<script language="php"> </script>
D)<?php ?>

Question 30
After executing below code, What will be printed?

$var = 'a';
$VAR = 'b';

echo "$var$VAR";

A)ab
B)a
C)b
D)bb
E)aa

Question 31
usleep(1000000);
Above usleep() function pauses PHP for . . . .

A)10 seconds
B)100 microseconds
C)1 microseconds
D)1 second

Question 32
What do you mean by LAMP?
A)Linux Apache Mysql PHP
B)Linux And Mysql PHP
C)Linux Apache Max PHP
D)Linux And Mysql Pages

Question 33
Which of the following function does not exist in PHP ?
A)is_string
B)is_number
C)is_object
D)is_array

Question 34
Which of the following is used to declare a constant in PHP?
A)constant
B)const
C)#pragma
D)define
E)def

Question 35
How many types of filtering are present in PHP ?
A)1
B)4
C)2
D)3

Question 36
Using which function in PHP we can move a file from one location to another ?
A)fopen
B)rename
C)fputs
D)move_uploaded_file

Question 37
PHP sessions are created using the . . . . . function.

A)session_start()
B)session_starts()
C)none of above
D)sessions_start()

Question 38
Which PHP function read content of a entire file and send it into an array ?

A)file_get_contents
B)fopen
C)fread
D)file

Question 39
What is the correct way to end a PHP statement?

A)	
B);
C).
D)!

Question 40
How do you write "Hello World" in PHP

A)"Hello World";
B)output("Hello World");
C)echo "Hello World";
D)Document.Write("Hello World");