Professional Documents
Culture Documents
Answer: d
Explanation: PHP previously stood for Personal Home Page now stands for Hypertext
Preprocessor.
Answer: c
3. Which of the following must be installed on your computer so as to run PHP script?
i) Adobe Dreamweaver
ii) XAMPP
iii) Apache and PHP
iv) IIS
i) /?
ii) //
iii) #
iv) /* */
a) Only ii)
b) i), iii) and iv)
c) ii), iii) and iv)
d) Both ii) and iv)
Answer: c
5. Which of the following PHP statement/statements will store 111 in variable num?
Answer: c
1. <?php
2. $num = 1;
3. $num1 = 2;
4. print $num . "+". $num1;
5. ?>
a) 3
b) 1+2
c) 1.+.2
d) Error
Answer: b
<?php
$num = "1";
$num1 = "2";
print $num+$num1;
?>
a) 3
b) 1+2
c) Error
d) 12
Answer: a
Explanation: The numbers inside the double quotes are considered as integers and not
string, therefore the value 3 is printed and not 1+2.
<?php
$total = "25 students";
$more = 10;
$total = $total + $more;
echo "$total";
?>
a) Error
b) 35 students
c) 35
d) 25 students
Answer: c
Explanation: The integer value at the beginning of the original $total string is used in the
calculation. However if it begins with anything but a numerical value, the value will be 0.
A.Server-side
B.Client-side
C.Browser-side
D.In-side
Answer : Server-side [Option : A]
Answer : C
a. pws- php5cgi.reg
b.php.ini
c.httpd.conf
d. httpd-info.conf
Ans-b
a. class
b. function
c.data value
d. none
Ans-c
Ans- d
Ans-C
Ans-C
Ans-B
Ans-D
Ans-A
Ans-B
21. Which of the following is not the scope of Variable in PHP?
A. Local
B. Global
C. Static
D. Extern
Ans-D
Ans-A
Ans-B
1. <?php
2. print "echo hello world";
3. ?>
a) echo hello world
b) hello world
c) nothing
d) error
Ans-a
1. <?php
2. $one = 1;
3. print($one);
4. print $one;
5. ?>
a) 01
b) 11
c) 10
d) Error
Ans-b
1. <?php
2. $one = "one";
3. $two = "two";
4. print($one$two);
5. ?>
a) onetwo
b) one
c) nothing
d) error
Ans-d
1. <?php
2. $one = "one";
3. $two = "two";
4. print($one,$two);
5. ?>
a) onetwo
b) one, two
c) one
d) error
Ans-d
1. <?php
2. $one = "one";
3. $two = "two";
4. print("$one$two");
5. ?>
a) onetwo
b) $one$two
c) one
d) error
Ans-a
1. <?php
2. print "Hello world!<br>";
3. print "I'm about to learn PHP!";
4. ?>
a) Hello world!
I’m about to learn PHP!
b) Hello world! I’m about to learn PHP!
c)Hello world!
I'm about to learn PHP!
d) Error
Ans-C
1. What does PHP stand for?
i) Personal Home Page
ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor
iv) Preprocessor Home Page
a) Both i) and iii)
b) Both ii) and iv)
c) Only ii)
d) Both i) and ii)
Answer: d
Answer: c
Answer: c
Answer: b
5. Which of the following must be installed on your computer so as to run PHP script?
i) Adobe Dreamweaver
ii) XAMPP
iii) Apache and PHP
iv) IIS
a) i), ii), iii) and iv)
b) Only ii)
c) ii) and iii)
d) ii), iii) and iv)
Answer: d
6. Which version of PHP introduced Try/catch Exception?
a) PHP 4
b) PHP 5
c) PHP 6
d) PHP 5 and later
Answer: d
Answer: c
8. Which of the following PHP statement/statements will store 111 in variable num?
i) int $num = 111;
ii) int mum = 111;
iii) $num = 111;
iv) 111 = $num;
a) Both i) and ii)
b) i), ii), iii) and iv)
c) Only iii)
d) Only i)
Answer: c
Answer: b
Answer: a
Answer: d
Answer: c
3. Which of the following PHP statements will output Hello World on the screen?
i) echo ("Hello World");
ii) print ("Hello World");
iii) printf ("Hello World");
iv) sprintf ("Hello World");
a) i) and ii)
b) i), ii) and iii)
c) i), ii), iii) and iv)
d) i), ii) and iv)
Answer: b
Answer: c
Answer: c
Answer: b
Answer: a
Answer: a
Answer: d
Answer: c
Answer: b
Answer: a
4. Which of the conditional statements is/are supported by PHP?
i) if statements
ii) if-else statements
iii) if-elseif statements
iv) switch statements
a) Only i)
b) i), ii) and iv)
c) ii), iii) and iv)
d) i), ii), iii) and iv)
Answer: d
Answer: c
Answer: c
Answer: b
Answer: d
9. What will be the value of $a and $b after the function call in the following PHP code?
1. <?php
2. function doSomething( &$arg ) {
3. $return = $arg;
4. $arg += 1;
5. return $return;
6. }
7. $a = 3;
8. $b = doSomething( $a );
9. ?>
a) a is 3 and b is 4
b) a is 4 and b is 3
c) Both are 3
d) Both are 4
Answer: b
Answer: a
Answer: c
Answer: a
Answer: b
4. Which of the following PHP function will return true if a variable is an array or false if it
is not an array?
a) this_array()
b) is_array()
c) do_array()
d) in_array()
Answer: b
Answer: d
Answer: d
Answer: a
8. Which of the following function is used to get the value of the previous element in an
array?
a) last()
b) before()
c) prev()
d) previous()
Answer: c
Answer: d
Answer: c
Answer: d
Answer: d
Answer: d
Answer: a
Answer: a
Answer: c
Answer: b
Answer: d
Answer: b
Answer: c
2. What will be the output of the following PHP code?
1. <?php
2. $a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" =>
"yellow");
3. $result = array_flip($a1);
4. print_r($result);
5. ?>
a) Array ( [red] => red [green] => green [blue] => blue [yellow] => yellow )
b) Array ( [a] => a [b] => b [c] => c [d] => d )
c) Array ( [red] => a [green] => b [blue] => c [yellow] => d )
d) Array ( [a] => red [b] => green [c] => blue [d] => yellow )
Answer: c
Answer: a
Answer: b
Answer: c
6. What will be the output of the following PHP code?
1. <?php
2. $city_west = array("NYC", "London");
3. $city_east = array("Mumbai", "Beijing");
4. print_r(array_replace($city_west, $city_east));
5. ?>
a) Array ( [1] => Mumbai [0] => Beijing )
b) Array ( [0] => NYC [1] => London )
c) Array ( [1] => NYC [0] => London )
d) Array ( [0] => Mumbai [1] => Beijing )
Answer: d
Answer: b
Answer: a
Answer: a
Answer: c
Answer: b
Answer: c
Answer: d
Answer: b
Answer: a
Answer: a
Answer: d
Answer: c
Answer: d
Answer: a
Answer: b
Answer: c
Answer: c
Answer: c
Answer: a
Answer: d
Answer: c
9. What will be the output of the following PHP code?
1. <?php
2. $number = array ("4", "hello", 2);
3. echo (array_sum ($number));
4. ?>
a) 4hello2
b) 4
c) 2
d) 6
Answer: d
Answer: b
Answer: d
Answer: b
3. Which type of function call is used in line 8 in the following PHP code?
1. <?php
2. function calc($price, $tax)
3. {
4. $total = $price + $tax;
5. }
6. $pricetag = 15;
7. $taxtag = 3;
8. calc($pricetag, $taxtag);
9. ?>
a) Call By Value
b) Call By Reference
c) Default Argument Value
d) Type Hinting
Answer: a
Answer: c
Answer: b
Answer: a
Answer: c
Answer: c
Answer: a
Answer: d
1. Which of the following PHP functions accepts any number of parameters?
a) func_get_argv()
b) func_get_args()
c) get_argv()
d) get_argc()
Answer: b
2. Which one of the following PHP functions can be used to find files?
a) glob()
b) file()
c) fold()
d) get_file()
Answer: a
3. Which of the following PHP functions can be used to get the current memory usage?
a) get_usage()
b) get_peak_usage()
c) memory_get_usage()
d) memory_get_peak_usage()
Answer: c
4. Which of the following PHP functions can be used for generating unique ids?
a) uniqueid()
b) id()
c) md5()
d) mdid()
Answer: a
Answer: d
Answer: d
Answer: c
Answer: b
Answer: d
Answer: a
1. PHP has long supported two regular expression implementations known as _______
and _______
i) Perl
ii) PEAR
iii) Pearl
iv) POSIX
a) i) and ii)
b) ii) and iv)
c) i) and iv)
d) ii) and iii)
Answer: c
2. Which one of the following regular expression matches any string containing zero or
one p?
a) p+
b) p*
c) P?
d) p#
Answer: c
Answer: b
4. How many functions does PHP offer for searching strings using POSIX style regular
expression?
a) 7
b) 8
c) 9
d) 10
Answer: a
Answer: b
Answer: d
Answer: a
Answer: d
9. Which of the following would be a potential match for the Perl-based regular
expression /fo{2,4}/?
i) fol
ii) fool
iii) fooool
iv) fooooool
a) Only i)
b) ii) and iii)
c) i), iii) and iv)
d) i) and iv)
Answer: b
Answer: a
1. How many functions does PHP offer for searching and modifying strings using Perl-
compatible regular expressions.
a) 7
b) 8
c) 9
d) 10
Answer: b
Answer: c
3. Say we have two compare two strings which of the following function/functions can
you use?
i) strcmp()
ii) strcasecmp()
iii) strspn()
iv) strcspn()
a) i) and ii)
b) iii) and iv)
c) only i)
d) i), ii), iii) and iv)
Answer: d
4. Which one of the following functions will convert a string to all uppercase?
a) strtoupper()
b) uppercase()
c) str_uppercase()
d) struppercase()
Answer: a
Answer: a
]
6. What will be the output of the following PHP code?
1. <?php
2. echo str_pad("Salad", 5)." is good.";
3. ?>
a) SaladSaladSaladSaladSalad is good
b) is good SaladSaladSaladSaladSalad
c) is good Salad
d) Salad is good
Answer: d
7. Which one of the following functions can be used to concatenate array elements to
form a single delimited string?
a) explode()
b) implode()
c) concat()
d) concatenate()
Answer: b
8. Which one of the following functions finds the last occurrence of a string, returning its
numerical position?
a) strlastpos()
b) strpos()
c) strlast()
d) strrpos()
Answer: d
Answer: c
Answer: d
1. The practice of separating the user from the true inner workings of an application
through well-known interfaces is known as _________
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction
Answer: c
2. Which of the following term originates from the Greek language that means “having
multiple forms,” defines OOP’s ability to redefine, a class’s characteristics?
a) Abstraction
b) Polymorphism
c) Inheritance
d) Differential
Answer: b
Answer: d
Answer: a
5. Which one of the following can be used to instantiate an object in PHP assuming
class name to be Foo?
a) $obj = new $foo;
b) $obj = new foo;
c) $obj = new foo ();
d) obj = new foo ();
Answer: c
Answer: d
7. Which one of the following is the right way to call a class constant, given that the class
is mathFunction?
a) echo PI;
b) echo mathFunction->PI;
c) echo mathFunction::PI;
d) echo mathFunction=PI;
Answer: c
Answer: a
Answer: c
10. Which of the following method scopes is/are not supported by PHP?
i) private
ii) friendly
iii) static
iv) abstract
a) Only ii)
b) Only iv)
c) ii) and iv)
d) Only i)
Answer: a
Answer: c
Answer: c
Answer: d
Answer: b
5. Which one of the following functions is used to determine whether a class exists?
a) exist()
b) exist_class()
c) class_exist()
d) __exist()
Answer: c
Answer: c
7. Which one of the following keyword is used to inherit our subclass into a superclass?
a) extends
b) implements
c) inherit
d) include
Answer: a
Answer: b
9. Which keyword is used to refer to properties or methods within the class itself?
a) private
b) public
c) protected
d) $this
Answer: d
10. Which keyword allows class members (methods and properties) to be used without
needing to instantiate a new instance of the class?
a) protected
b) final
c) static
d) private
Answer: c
1. Which of the following advanced OOP features is/are not supported by PHP?
i) Method overloading
ii) Multiple Inheritance
iii) Namespaces
iv) Object Cloning
a) i)
b) ii)
c) i) and ii)
d) iii) and iv)
Answer: c
Answer: b
Answer: b
4. The class from which the child class inherits is called ________
i) Child class
ii) Parent class
iii) Super class
iv) Base class
a) Only i)
b) ii), iii) and iv)
c) Only iii)
d) ii) and iv)
Answer: d
Answer: a
6. If one intends to create a model that will be assumed by a number of closely related
objects, which class must be used?
a) Normal class
b) Static class
c) Abstract class
d) Interface
Answer: c
7. If your object must inherit behavior from a number of sources you must use a/an
a) Interface
b) Object
c) Abstract class
d) Static class
Answer: a
9. Which feature allows us to call more than one method or function of the class in single
instruction?
a) Typecasting
b) Method Including
c) Method adding
d) Method chaining
Answer: d
Answer: a
1. Which one of the following statements should be used to disable just the fopen(), and
file() functions?
a) disable_functions = fopen(), file()
b) disable_functions = fopen, file
c) functions_disable = fopen(), file()
d) functions_disable = fopen, file
Answer: b
2. Which one of the following statements should be used to disable the use of two
classes administrator and janitor?
a) disable_classes = “administrator, janitor”
b) disable_classes = class administrator, class janitor
c) disable_classes = class “administrator”, class “janitor”
d) disable_class = class “administrator”, class “janitor”
Answer: a
Answer: c
4. The memory_limit is only applicable if ________ is enabled when you configure PHP.
a) –enable-limit
b) -enable-memory-limit
c) –enable-memory-limit
d) -memory-limit
Answer: c
5. Suppose all web material is located within the directory /home/www. To prevent users
from viewing and manipulating files such as /etc/password, which one of the following
statements should you use?
a) open_dir = “/home/www/”
b) open_dir = /home/www/
c) open_basedir = /home/www/
d) open_basedir = “/home/www/”
Answer: d
6. Which Apache directive outputs Apache’s server version, server name, port and
compile-in modules?
a) ServerSignature
b) ServerName
c) ServerDetails
d) ServerInfo
Answer: a
Answer: c
8. Which directive should we disable to obscure the fact that PHP is being used on our
server?
a) show_php
b) expose_php
c) print_php
d) info_php
Answer: b
9. Say I want to change the extension of a PHP file, which of the following statements
should I edit to change from .php to .html in the httpd.conf file?
a) AddType application/x-httpd-php .php
b) AddType application/x-httpd-php .asp
c) AddType application/x-httpd-asp .php
d) AddType application/x-httpd-asp .asp
Answer: a
10. The developers of PHP deprecated the safe mode feature as of which PHP version.
a) PHP 5.1.0
b) PHP 5.2.0
c) PHP 5.3.0
d) PHP 5.3.1
Answer: c
Answer: c
Answer: d
Answer: c
Answer: c
Answer: d
Answer: d
Answer: c
Answer: c
Answer: a
Answer: b
Answer: c
Answer: b
Answer: d
Answer: d
Answer: b
Answer: c
Answer: d
Answer: c
Answer: a
Answer: d
Answer: d
Answer: b
Answer: d
Answer: a
Answer: a
Answer: c
Answer: b
Answer: b
Answer: b
Answer: d
Answer: d
Answer: b
Answer: a
Answer: b
Answer: c
Answer: a
Answer: b
Answer: c
Answer: b
Answer: a
Answer: c
Answer: c
Answer: c
Answer: b
Answer: d
Answer: d
Answer: b
Answer: a
CA 6.2 PHP and MySql A
N
S
1) What does PHP stand for? D
i) Personal Home Page
ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor
iv) Preprocessor Home Page
1 P.T.O.
10) How many main parameter are used in for loop? B
A)2
B)3
C)4
D)1
11) PHP supports ____ types of looping techniques? C
A)2
B)3
C)4
D)5
12) How many value does Boolean data type hold? B
A)1
B)2
C)3
D)4
13) How many types of functions are available in php? D
A)5
B)4
C)3
D)2
14) In MySQL databases, the structure representing the organizational views of the entire databases is A
____________
A)Schema
B)View
C)Instance
D)Table
15) Why should we use functions? D
A)Reusability
B)Easier error detection
C)Easily maintained
D)All of the above
16) Which of the following operators is/are used in “Condition Evaluation”? D
A)AND
B)OR
C)NOT
D)All of the mentioned
17) What will be the output of the following PHP code? A
<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
a();
a();
?>
A)I am a
B)I am bI am a
C)Error
D)I am a Error
2
18) Any variables declared in PHP must begin with a _____? D
A).
B)#
C)&
D)$
19) What represents an ‘attribute’ in a relational database? C
A)Table
B)Row
C)Column
D)Object
20) A variable name can only contain ____________? C
A)alphanumeric characters
B)underscores
C)Both A and B
D)None of the above
21) What represents a ‘tuple’ in a relational database? B
A)Table
B)Row
C)Column
D)Object
22) foreach loop is used to iterate over ____? D
A)number
B)object
C)function
D)array
23) Which is the MySQL instance responsible for data processing? B
A)MySQL client
B)MySQL server
C)SQL
D)Server daemon program
24) Which type of database management system is MySQL? C
A)Object-oriented
B)Hierarchical
C)Relational
D)Network
25) Which variable is used to collect form data sent with both the GET and POST methods? D
A) $BOTH
B) $_BOTH
C) $REQUEST
D) $_REQUEST
26) do-while loop is an _____ control loop ? A
A)exit
B)exist
C)easy
D)entry
27) How many ways can a session data be stored? B
A)3
B)4
C)5
D)6
3 P.T.O.
28) Can “SELECT” clause be used without the clause “FROM”? B
A)YES
B)NO
C)DEPENDS
D)None of the mentioned
29) Which of the following function returns the number of characters in a string variable? D
A.count($variable)
B.len($variable)
C.strcount($variable)
D.strlen($variable)
30) How is communication established with MySQL? A
A)SQL
B)Network calls
C)A programming language like C++
D)APIs
31) Which of the following method sends input to a script via a URL? B
A.Get
B.Post
C.Both
D.None
32) while loop is an _____ control loop ? D
A)exit
B)exist
C)easy
D)entry
33) Which of the following clause is evaluated in the last by database server? A
A)SELECT
B)WHERE
C)FROM
D)None of the mentioned
34) Which one of the following is the very first task executed by a session enabled page? C
A)Delete the previous session
B)Start a new session
C)Check whether a valid session exists
D)Handle the session
35) What will be the output of the following PHP code? D
<?php
echo str_pad("Salad", 5)." is good.";
?>
A)SaladSaladSaladSaladSalad is good
B)is good SaladSaladSaladSaladSalad
C)is good Salad
D)Salad is good
4
36) What will be the output of the following PHP code? B
<?php
$fname = array("Peter", "Ben", "Joe");
$age = array("35", "37", "43");
$c = array_combine($fname, $age);
print_r($c);
?>
<?php
for ($x = 0; $x <= 10; print ++$x)
{
print ++$x;
}
?>
A) 123456789101112
B) 12345678910
C) 1234567891011
D) infinite loop
38) What will be the output of the following PHP code? C
<?php
for ($i++; $i == 1; $i = 2)
print "In for loop ";
print "After loop\n";
?>
A) In for loop
B) After for loop
C) In for loopAfter for loop
D) Infinite loop
39) What will be the output of the following PHP code? D
<?php
function constant()
{
define("GREETING", "Welcome to Narnia");
echo greeting;
}
?>
A)Welcome to Narnia
B)greeting
C)GREETING
D)ERROR
5 P.T.O.
40) What will be the output of the following PHP code? B
<?php
for (1; $i == 1; $i = 2)
print "In for loop ";
print "After loop\n";
?>
A) In for loop
B) After for loop
C) In for loopAfter for loop
D) Infinite loop
41) Which of the following variables is not a predefined variable? B
A)$get
B)$ask
C)$request
D)$post
42) Which function is used to remove all HTML tags from a string passed to a form? B
A)remove_tags()
B)strip_tags()
C)tags_strip()
D)tags_remove()
43) Which one of the following PHP functions can be used to find files? A
A) glob()
B) file()
C) fold()
D) get_file()
44) What will be the output of the following PHP code? D
<?php
for ($count = 0; $count<3;$count++);
{
print "hi";break;print "hello";
}
?>
A) hihihi
B) hihellohihellohihello
C) hellohellohello
D) hi
45) What will be the output of the following PHP code? B
<?php
for(;;)
{
print "10";
}
?>
A) 10
B) infinite loop
C) no output
D) error
6
46) What will be the output of the following PHP code? B
<?php
for ($i = 0; -5 ; $i++)
{
print"i";
if ($i == 3)
break;
}
?>
A) 0 1 2 3 4
B) 0 1 2 3
C) 0 1 2 3 4 5
D) error
47) What will be the output of the following PHP code? C
<?php
for ($i = 0;$i = -1;$i = 1)
{
print $i;
if ($i != 1)
break;
}
?>
A) 0
B) infinite loop
C) -1
D) 1
48) What will be the output of the following PHP code? C
<?php
function calc($price, $tax="")
{
$total = $price + ($price * $tax);
echo "$total";
}
calc(42);
?>
A)Error
B)0
C)42
D)84
49) What will be the output of the following PHP code? C
<?php
echo ord ("hi");
?>
A) 106
B) 103
C) 104
D) 209
7 P.T.O.
50) What will be the output of the following PHP code? A
<?php
echo lcfirst("welcome to India");
?>
A) welcome to India
B) welcome to india
C) Welcome to India
D) Welcome to india
51) How many validation filters like FILTER_VALIDATE_EMAIL are currently available? C
A)5
B)6
C)7
D)8
52) Which of the following PHP functions can be used for generating unique ids? A
A) uniqueid()
B) id()
C) md5()
D) mdid()
53) Which version of PHP introduced the instanceof keyword? B
A) PHP 4
B) PHP 5
C) PHP 5.3
D) PHP 6
54) Which one of the following keyword is used to inherit our subclass into a superclass? A
A) extends
B) implements
C) inherit
D) include
55) Which keyword is used to refer to properties or methods within the class itself? D
A) private
B) public
C) protected
D) $this
56) If your object must inherit behavior from a number of sources you must use a/an A
A) Interface
B) Object
C) Abstract class
D) Static class
57) Which of the following is/are an external data? D
i) Cookies
ii) Input data from a form
iii) Server Variables
iv) Web services data
A) Only ii)
B) ii) and iii)
C) Only iii)
D) i), ii), iii) and iv)
8
58) _________this regular expression matches any string containing zero or one p? C
A) p+
B) p*
C) P?
D) p#
59) What will be the output of the following PHP code? C
<?php
function addFunction($num1, $num2)
{
$sum = $num1 + $num2;
return $sum;
}
$return_value = addFunction(10, 20);
echo "Returned value from the function : $return_value"
?>
<?php
function sayHello()
{
echo "HelloWorld<br />";
}
$function_holder = "sayHello";
$function_holder();
?>
A) No Output
B) Error
C) sayHello
D) HelloWorld
61) What will be the output of the following PHP code? A
<?php
function do($myString)
{
echo strpos($myString, "donkey",0);
}
do("The donkey looks like a horse.");
?>
A) 4
B) 5
C) 2
D) None of the mentioned
62) To validate an email address, which flag is to be passed to the function filter_var()? A
A)FILTER_VALIDATE_EMAIL
B)FILTER_VALIDATE_MAIL
C)VALIDATE_EMAIL
D)VALIDATE_MAIL
9 P.T.O.
63) What will be the output of the following PHP code? A
<?php
for ($count = 1; $count != 20;$count++)
{
print $count;
$count++;
}
?>
A) Infinite
B) 123…….20
C) 1357…19
D) 13579…21
64) What will be the output of the following PHP code? B
<?php
function sum($num1, $num2)
{
$total = $num1 + $num2;
echo "cos($total)";
}
sum(5,-5);
?>
A) 0
B) 1
C) 0.5
D) -0.5
65) What will be the output of the following PHP code? A
<?php
for ($x = 1; $x < 10; $x++)
for ($y = 1; $y < 5; $y++)
print "Hello";
?>
A) Hello….36 times
B) Hello….45 times
C) Hello….50 times
D) Hello….40 times
66) What will be the output of the following PHP code? A
<?php
echo hex2bin("48656c6c6f20576f726c6421");
?>
A) Hello World!
B) welcome to india
C) This is PHP!
D) MCQ questons
10
67) What will be the output of the following PHP code? B
<?php
$cars = array("Volvo", "BMW", "Toyota");
echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";
?>
<?php
echo lcfirst("welcome to India");
?>
A) welcome to India
B) welcome to india
C) Welcome to India
D) Welcome to india
69) If the directive session.cookie_lifetime is set to 3600, the cookie will live until ____________ A
A)3600 sec
B)3600 min
C)3600 hrs
D)the browser is restarted
70) What will be the output of the following PHP code? B
<?php
echo strtr("Hilla Warld","ia","eo");
?>
A) Hilla Warld
B) Hello World
C) ia
D) eo
71) Which of the following is not true? D
A.PHP can be used to develop web applications.
B.PHP makes a website dynamic
C.PHP applications can not be compile
D.PHP can not be embedded into html
11 P.T.O.
72) What will be the output of the following PHP code? C
<?php
function mine($num)
{
$num = 2 + $num;
echo $num;
}
mine(3);
?>
A) 3
B) $num
C) 5
D) None of the mentioned
73) If session.use_cookie is set to 0, this results in use of _____________ C
A)Session
B)Cookie
C)URL rewriting
D)Nothing happens
74) What will be the output of the following PHP code? B
<?php
$x = 10;
$y = 20;
if ($x > $y && 1||1)
print "hi" ;
else
print "how are u";
?>
A)how are u
B)hi
C)error
D)no output
75) What will be the output of the following PHP code? A
<?php
function _func()
{
echo "Hello World";
}
_func();
?>
A) Hello World
B) No Output
C) ERROR
D) None of the mentioned
76) When you use the $_GET variable to collect data, the data is visible to ___________ C
A) none
B) only you
C) everyone
D) selected few
12
77) What will be the output of the following PHP code? D
<?php
function constant()
{
define("GREETING", "Welcome to Narnia");
echo greeting;
}
?>
A) Welcome to Narnia
B) greeting
C) GREETING
D) ERROR
78) ___ function will return true if a variable is an array or false if it is not an array? B
A)this_array()
B)is_array()
C)do_array()
D)in_array()
79) _____ determines whether the old session file will also be deleted when the session ID is B
regenerated?
A) delete_old_file
B) delete_old_session
C) delete_old_session_file
D) delete_session_file
80) What will be the output of the following PHP code? D
<?php
function time($string)
{
echo strtr("Towe Pa55", "ow5", $string);
}
time("ims");
?>
A) Time Pa55
B) Towe Pa55
C) Towe Pass
D) Time Pass
81) What is the meaning of “SELECT” clause in Mysql? A
A)Show me all Columns and rows
B)Show me all columns
C)Show me all rows
D)None of the mentioned
82) Which one of the following statements should you use to set the session username to Nachi? B
A) $SESSION[‘username’] = “Nachi”;
B) $_SESSION[‘username’] = “Nachi”;
C) session_start(“nachi”);
D) $SESSION_START[“username”] = “Nachi”;
83) PHP files have a default file extension of_______ C
A).html
B).xml
C).php
D).ph
13 P.T.O.
84) Which function is used to erase all session variables stored in the current session? D
A) session_destroy()
B) session_change()
C) session_remove()
D) session_unset()
85) Which version of PHP introduced Try/catch Exception? D
A)PHP 4
B)PHP 5
C)PHP 6
D)PHP 5 and later
86) Which one of the following function is used to start a session? B
A) start_session()
B) session_start()
C) session_begin()
D) begin_session()
87) A function in PHP which starts with __ (double underscore) is known as __________ A
A)Magic Function
B)Inbuilt Function
C)Default Function
D)User Defined Function
88) What is the default time(in seconds) for which session data is considered valid? C
A) 1800
B) 3600
C) 1440
D) 1540
89) Which one is not a data type in PHP? D
A)Resources
B)Objects
C)Null
D)Void
90) Which one of the following is the default PHP session name? A
A) PHPSESSID
B) PHPSESID
C) PHPSESSIONID
D) PHPIDSESS
91) _____ returns an array consisting of associative key/value pairs? C
A)count()
B)array_count()
C)array_count_values()
D)count_values()
92) How many ways can a session data be stored? B
A) 3
B) 4
C) 5
D) 6
93) ______ is not a built-in function in php ? C
A)print_r()
B)echo()
C)fclosed()
D)gettype()
14
94) Which one of the following is the very first task executed by a session enabled page? C
A) Delete the previous session
B) Start a new session
C) Check whether a valid session exists
D) Handle the session
95) Objects are defined as instances of user defined classes that can hold ____________? C
A)values
B)functions
C)both values and functions
D)None of the above
96) _____function finds the last occurrence of a string, returning its numerical position? D
A) strlastpos()
B) strpos()
C) strlast()
D) strrpos()
97) Which loop evaluates the condition expression as Boolean, if it is true, it executes the statements B
and when it is false it will terminate?
A)For loop
B)while loop
C)do-while loop
D)All of the above
98) A function name is not case-sensitive? A
A)True
B)False
C)Only user-defined function is case-sensitive
D)None of the above
99) [:alpha:] can also be specified as ________ B
A) [A-Za-z0-9]
B) [A-za-z]
C) [A-z]
D) [a-z]
100) What will be the output of the following PHP code? C
<?php
function email()
{
$email = ’user@yahoo.com’;
$new = strstr($email, ‘@');
echo $new;
}
email();
?>
A)user
B)user@yahoo.com
C)@yahoo.com
D)yahoo.com
**********
15 P.T.O.
Subject Code CA 6.3
QUE.
QUESTION ANS
NO.
In Inter task testing once errors in individual tasks and in system behavior have
been isolated, testing shifts to time related errors.
1 B
A) System related error B) time related error C) Behavioral error D) None of these
Select the people who identify the document and verify the correctness of the
2 software… B
A) Project manager B) SQA team C) Project team D) All of the mentioned
The waterfall model of software development is
A) A reasonable approach when requirements are well defined.
B) A good approach when a working program is required quickly.
3 A
C) The best approach to use for projects with large development teams
D) An old fashioned model that is rarely used any more
………………… can be used to define various classes and input and associated
interactions.
A) equivalence partitioning and graph based testing
5 B) equivalence partitioning and boundary value analysis B
C) condition testing and equivalence partitioning
D) graph based testing and boundary value analysis
During which activity, tester will decide if extra test cases are required or
not?
A) Test implementation and execution
18 B) Test planning and control C
C) test analysis and design
D) Evaluating exit criteria
White-box testing sometimes called ………………… is a test case design method that
uses the control structure of the procedural design to derive test cases.
21 A) Glass-box testing B) Control structure testing A
C) Black-box testing D) Gray-box testing
Software tester focuses more on complex part of the software. Which of the
following testing principle implies this?
32 D
A) Testing shows presence of defects B) Pesticide paradox
C) Testing is context dependent D) Defect Clustering
A) Unit,Integration, System,Acceptance
42 B) Unit ,System, Integration,Acceptance D
C) Unit, Integration, Acceptance, System
D) It depends on nature of a project.
……………. enables the software engineer to derive sets of input conditions that will
fully exercise all functional requirements for a program.
43 A) White-box testing B) Control structure testing C
C) Black-box testing D) Gray-box testing
……………… is black-box testing method that divides the input domain of a program
into classes of data from which test cases can be derived.
46 C
A) Condition testing B) Graph-based testing
C) Equivalence partitioning D) loop testing
Component testing is a
48 B
A) Black box testing B) White box testing C) Grey box testing D) Both a and b
A particular text field accepts only alpha characters. Which of the following is
61 invalid Equivalence Partition? D
A) APPLE B) apple C) aPPle D)a2pple
While using black-box testing techniques, we drive a set of test cases that
satisfy which of the following criteria.
i) test cases that reduce, by a count that is greater than one.
ii) test cases that tell us something about the presence or absence of classes of
64 A
errors.
iii) execute all loops at their boundaries and within their operational bounds.
A) i and ii B) ii and iii C) i and iii D) All i, ii and iii
A document that contains description of any event that has happened which
requires further investigation is called as a
78 D
A) Test summary report B) Defect report
C) Bug report D) Incident report
What types of errors are not done by Black-Box Testing and can be uncovered
81 by White-Box Testing? A
A)Logic errors B) Performance errors C) Behavioral errors D) None of these
QUE.
QUESTION ANS
NO.
A data warehouse is which of the following?
A. Many-to-many
2 B. One-to-one C
C. One-to-many
D. All of the above.
A. Once created, the data marts will keep on being updated from the data
warehouse at periodic times
4 A
B. Once created, the data marts will directly receive their new data from the
operational databases
C. The data marts are different groups of tables in the data warehouse
D.A data mart becomes a data warehouse when it reaches a critical size
The following technology is not well-suited for data mining:
A. Functionality
8 D
B. Vendor consideration
C. Compatibility
D. All of the above
Cluster is?
A. This takes only two values. In general, these values will be 0 and 1
and they can be coded as one bit.
10 C
B. The natural environment of a certain species
C. Systems that can be used without knowledge of internal operations
D. None of these
A. Complete
11 B. Consistent A
C. Constant
D. None of these
Data mining is
A. Complete
13 B
B. Consistent
C. Constant
D. None of these
A. Dotted rectangle
15 B. Diamond C
C. Doubly outlined rectangle
D. None of these
OLAP stands for
17 a) Multidimensional A
b) Single dimensional
c) Measured
d) Dimensional
What do data warehouses support?
a) OLAP
18 A
b) OLTP
c) OLAP and OLTP
d) Operational databases
The full form of OLAP is
a) SMTOP
20 b) OLTP B
c) FTP
d) OLAP
What is noise?
a) component of a network
24 b) context of KDD and data mining B
c) aspects of a data warehouse
d) None of these
26 A. Data Mining. B
B. Data Warehousing.
C. Web Mining.
D. Text Mining.
The data Warehouse is__________.
A. read only.
27 A
B. write only.
C. read write only.
D. none.
Expansion for DSS in DW is__________.
A. 1-2 years.
30 D
B. 3-4years.
C. 5-6 years.
D. 5-10 years.
The data is stored, retrieved & updated in ____________.
A. OLAP.
31 B. OLTP. B
C. SMTP.
D. FTP.
A. Relational data.
32 B. Operational data. C
C. Metadata.
D. Informational data.
A. Data warehouse.
33 B
B. Data mining.
C. Datamarts.
D. Metadata.
35 A. Oracle. D
B. DBZ.
C. Informix.
D. Redbrick.
A. Mushy metadata.
36 A
B. Differential metadata.
C. Data warehouse.
D. Data mining.
37 A. Informational. B
B. Operational.
C. Both informational and operational.
D. Flat.
A. one.
38 B. two. A
C. three.
D. four.
A. 30-60 days.
39 B. 60-90 days. B
C. 90-120 days.
D. 120-150 days.
A. time.
40 A
B. cost.
C. frequency.
D. quality.
Data can be updated in _____environment.
A. data warehouse.
41 C
B. data mining.
C. operational.
D. informational.
A. OLTP
42 D
B. files
C. RDBMS
D. data warehouse
43 A. normalized. C
B. informational.
C. summary.
D. denormalized.
44 A. one. A
B. two.
C. three.
D. four.
A. monoatomic data.
45 C
B. diatomic data.
C. atomic data.
D. multiatomic data.
A data warehouse is _____________.
A. a process to reject data from the data warehouse and to create the necessary
indexes.
B. a process to load the data in the data warehouse and to create the necessary
47 B
indexes.
C. a process to upgrade the quality of data after it is moved into a data
warehouse.
D. a process to upgrade the quality of data before it is moved into a data
warehouse.
A. many-to-many.
48 B. one-to-one. C
C. one-to-many.
D. many-to-one.
A. completely demoralized.
49 C
B. partially demoralized.
C. completely normalized.
D. partially normalized.
A. Once created, the data marts will keep on being updated from the data
warehouse at periodic times
52 B. Once created, the data marts will directly receive their new data from the A
operational databases
C. The data marts are different groups of tables in the data warehouse
D. A data mart becomes a data warehouse when it reaches a critical size
A. DBMS.
B. RDBMS.
54 C. Sybase. B
D. SQL Server.
A. A column
B. A row
57 D
C. An attribute
D. A relation
A. DBMS.
B. RDBMS.
60 C. Sybase. B
D. SQL Server.
The time horizon in Data warehouse is usually __________.
A. 1-2 years.
61 D
B. 3-4years.
C. 5-6 years.
D. 5-10 years.
The data is stored, retrieved & updated in ____________.
A. OLAP.
62 B
B. OLTP.
C. SMTP.
D. FTP.
____________predicts future trends & behaviors, allowing business
managers to make proactive, Knowledge-driven decisions.
63 A. Data warehouse. B
B. Data mining.
C. Datamarts.
D. Metadata.
__________ is the heart of the warehouse.
A. Oracle.
65 D
B. DBZ.
C. Informix.
D. Redbrick.
________________defines the structure of the data held in operational
databases and used by operational applications.
66 A. User-level metadata. C
B. Data warehouse metadata.
C. Operational metadata.
D. Data mining metadata
_________maps the core warehouse metadata to business concepts,
familiar and useful to end users.
68 A. Mushy metadata. A
B. Differential metadata.
C. Data warehouse.
D. Data mining
The star schema is composed of __________ fact table.
A. one.
69 A
B. two.
C. three.
D. four.
The time horizon in operational environment is ___________.
A. 30-60 days.
70 B
B. 60-90 days.
C. 90-120 days.
D. 120-150 days.
The key used in operational environment may not have an element
of__________.
71 A. time. A
B. cost.
C. frequency.
D. quality.
Data can be updated in _____environment.
A. data warehouse.
72 C
B. data mining.
C. operational.
D. informational.
Record cannot be updated in _____________.
A. OLTP
73 D
B. files
C. RDBMS
D. data warehouse
The source of all data warehouse data is the____________.
A. operational environment.
74 A
B. informal environment.
C. formal environment.
D. technology environment.
Data redundancy between the environments results in less than
____________percent.
75 A. one. A
B. two.
C. three.
D. four.
Fact tables are ___________.
A. completely demoralized.
76 B. partially demoralized. C
C. completely normalized.
D. partially normalized.
_______________ is the goal of data mining.
A. root node.
80 B
B. decision tree.
C. siblings.
D. branches.
The main organizational justification for implementing a data warehouse
is to provide ______.
A. DBMS.
82 B
B. RDBMS.
C. Sybase.
D. SQL Server
Source data from the warehouse comes from _______________.
A. ODS.
83 A
B. TDS.
C. MDDB.
D. ORDBMS.
________________ is a data transformation process.
A. Comparison.
84 D
B. Projection.
C. Selection.
D. Filtering.
The technology area associated with CRM is _______________.
A. specialization.
85 C
B. generalization.
C. personalization.
D. summarization.
MDDB stands for ___________.
A. Digital directory.
87 C
B. Repository.
C. Information directory.
D. Data dictionary.
___________ is data collected from natural systems.
A. MRI scan.
88 A
B. ODS data.
C. Statistical data.
D. Historical data.
____________ are some popular OLAP tools.
A. Metacube, Informix.
89 A
B. Oracle Express, Essbase.
C. HOLAP.
D. MOLAP.
Capability of data mining is to build ___________ models.
A. retrospective.
90 C
B. interrogative.
C. predictive.
D. imperative.
Strategic value of data mining is ______________.
A. cost-sensitive.
91 C
B. work-sensitive.
C. time-sensitive.
D. technical-sensitive.
The terms equality and roll up are associated with ____________.
A. OLAP.
92 C
B. visualization.
C. data mart.
D. decision tree.
Exceptional reporting in data warehousing is otherwise called as
__________.
93 A. exception. B
B. alerts.
C. errors.
D. bugs.
____________ is a metadata repository.
A. Analysis.
95 D
B. Study.
C. Design.
D. Information collection.
Removing duplicate records is a process called _____________.
A. recovery.
96 B
B. data cleaning.
C. data cleansing.
D. data pruning.
How many components are there in a data warehouse?
A. two.
97 D
B. three.
C. four.
D. five.
Metadata contains atleast _________.
A. Classification.
100 C
B. Regression.
C. Sequence discovery.
D. Association rules.
CA 6.5 Cyber Security (254605)
QUE.
QUESTION ANS
NO.
Which attack stores data in more space than its buffer allocation?
16 A). DoS attack B). Salami attack C
C). Buffer overflow attack D). Virus attack
______________ is the secure version of HTTP, the protocol over which data is
sent between the browser and the website that are connected to.
A). Hyper Text Transfer Protocol Secure
21 A
B). Hyper Text Transfer Protocol Security
C). File transfer protocol secure
D). File transfer protocol security
The term ‘Intellectual Property Rights’ covers
A)Copyrights B)Know-how
22 D
C)Trade dress D)All of the above
EDI requires
A) representation of common business documents in computer readable forms
25 B) data entry operators by receivers A
C) special value added networks
D) special hardware at co-operating Business premises
Which of the following is not a cloud based storage solutions?
26 D
A). Dropbox B). Google Drive C). OneDrive D). McAfee
The usage of the Internet for hours by an unauthorized person which is actually
paid by another person is called __________.
27 B
A). denial of service. B). internet time theft.
C). virus attack. D). cyber defamation.
________ provides the quantum of information on a specific risk.
28 A) Risk Governance B). Risk Measurement B
C). Risk monitoring D). Risk Mitigation
Which system provides administrator with the ability to instantly view and
change access rights?
A). Identity and access management
29 A
B). Data Loss Prevention
C). Security information and event management
D). Intrusion detection system
___________ monitor the user activity on internet and transmit the information
33 in the background someone else C
A). Malware B). Adware C). Spyware D). None of these
Information Technology act in India was amended in the year
34 C
A). 2000 B). 2004 C). 2008 D). 2010
The two most critical assets of any organization are its _______.
36 A). user and infrastructure B). user and data B
C). data and capital investment D). user and capital investment
DDOS is ______________
41 A). Distribution of service B). Duplication of work D
C). Cyber attack D). Distributed Denial of service
Electronic transfer of illegally obtained money with the goal of hiding its source
and possibly its destination is called as ______.
45 A
A). cyber laundering. B). assault by a threat.
C). cyber contraband. D). cyber stalking.
Intellectual Property Rights (IPR) protect the use of information and ideas that
are of
46 A)Ethical value B)Moral value D
C)Social value D)Commercial value
In the basic TCP/IP protocol suite, the number of layers used are _________.
48 A). 4 B). 6 C). 5 D). 7 A
. ______________ is the secure version of HTTP, the protocol over which data is
sent between the browser and the website that are connected to.
A). Hyper Text Transfer Protocol Secure
57 A
B). Hyper Text Transfer Protocol Security
C). File transfer protocol secure
D). File transfer protocol security
QUE.
QUESTION ANS
NO.
Which of the following describes an ERP system?
A) ERP systems provide a foundation for collaboration between departments
B) ERP systems enable people in different business areas to communicate
1. C) ERP systems have been widely adopted in large organizations to store critical
D
knowledge used to make the decisions that drive the organization’s performance
D) All of the above
What is at the heart of any ERP system?
A) Information
2. B) Employees D
C) Customers
D) Database
What are the primary business benefits of an ERP system?
A) Sales forecasts, sales strategies, and marketing campaigns
B) Market demand, resource and capacity constraints, and real-time scheduling
3. C) Forecasting, planning, purchasing, material management, warehousing, inventory, C
and distribution
D) All of the above
Answer:
Which one of the following is not a myth about ERP?
A) ERP means more work and procedures
4. B) ERP makes many employees redundant. C
C) ERP integrate and automate organization process
D) ERP is the sole responsibility of management
Which one of the following is the part of organization?
A) People
5. B) Common goal
C) Resources
D) All of the above
In SAP system, an administrator can also lock or unlock a user as per the requirement
either manually or automatically?
6. A) True
B) False
In SAP system architecture, which of the following layer communicates with the
application server to perform all the processing and which is known as brains of an SAP
7. system?
A) Application Server Layer
B) Presentation Layer
C) Database Layer
D) None of these
In the _________, ERP packages were targeted at the manufacturing industry.
A) 1970’s
8. B) 1990's
C) 1980’s
D) 1960’s
What must a system do to qualify as a true ERP solution?
A) Be flexible
9. B) Be modular and closed A
C) Extend within the company
D) All of the above
The _________ should plan well and execute perfectly the implementation of ERP.
A) Organisation
20. B
B) System developers
C) Vendors
D) Top Management
_________ module supports the entire sales and purchase processes from start to finish.
A) Order management
51. B) Sales management A
C) Purchase management
D) Master Data Management
_________ are the people who have developed the ERP packages.
A) Consultants.
56.
B) End users. D
C) Administrative team.
D) Vendors.
The final element of feedback is essential for system operation and for ……….
69. A. self-regulation
B. correct errors A
C. testing
D. debugging
The expert system uses a(n) …….. to select the most appropriate response.
A. inference
70.
B. decision support system A
C. knowledge base
D. data source
Which category of computer based information systems are concerned with
improving efficiency by applying information technology to common administrative
tasks, such as creating business documents?
71.
A. Office automation systems A
B. Strategic information systems
C. Expert systems
D. Business information systems
The data Warehouse is__________.
A. read only.
72.
B. write only. A
C. read write only.
D. none
Which of the following has the highest impact on the whole supply network?
A) Collaborative commerce
89. B) Manufacturing resource planning A
C) Materials requirements planning
D) Enterprise resource planning
Which of the following allows individual ERP systems to communicate with each
other?
A) Web-integrated ERP
90. B) Web-integrated MRP A
C) EMRP
D) Global ERP
What system helps make calculations regarding the volume and timing of materials
needed?
A) Materials resource planning
91. B) Material scheduling A
C) Product plan
D) Materials requirements planning
Manufacturing resource planning expanded out of materials requirements planning
during which decade?
A) 1970s
92. B) 1990s D
C) 1960s
D) 1980s
Which of the following occurs when everyone involved in sourcing, producing, and
delivering the company's product works with the same information? ERP MCQ with
solutions
93. A) Eliminates redundancies D
B) Cuts down wasted time
C) Removes misinformation
D) All of the above
Application server of the sap system is run by?
A) ABAP and JAVA
94. B) ABAP A
C) JAVA
D) C++
What are the names of the significant components that make up the SAP J2EE
Engine?
A) Clusters and Work Process
100.B) Dispatchers and Work Processes B
C) Servers and ICM
D) None of the above
Subject Name & Paper Code A
N
UG-CS-323-Internet Programming using PHP S
1) PHP Stands for B
(A) Php Hypertext Processor
(B) Write
(C) Echo
(D) Display
4) Which one of the following should not be used while sending passwords or other D
sensitive information?
(A) $BOTH
(B) $_BOTH
(C) $REQUEST
(D) $_REQUEST
1 P.T.O.
6) The following function will convert a string to all uppercase? B
(A) uppercase()
(B) strtoupper()
(C) str_uppercase()
(D) struppercase()
(B) False
(B) 2
(C) 0
(D) -1
2
11) Which of the following method use to upload the file to the current script? A
(A) $_GET
(B) $_POST
(C) $_REQUEST
(D) $_FILE
(B) Insert
(C) Update
(D) Alter
(A) It causes the dataset returned by the query to be sorted in descending order
(B) It causes the result set to include a description of the NAME field
(C) It causes rows with the same EMPID to be sorted by NAME in descending
order
(D) It causes rows to be sorted by NAME first and then by ID
15) Which directive determines how the session information will be stored? D
(A) save_data
(B) session.save
(C) session.save_data
(D) session.save_handler
3 P.T.O.
16) Which of the following is an exception? B
(A) OutBoundException
(B) OutOfRangeException
(C) OutOverflowException
(D) OutUnderflowException
18) PHP makes it possible to automatically execute code when a new instance of a B
class is created using a special class method called as
(A) destructor
(B) constructor
(C) friend
(D) Initial
1 Ram
2 Sita
4 Tanu
(A) 4
(B) 3
(C) 1
4
20) Which of the following method of Exception class returns source line? D
(A) getMessage()
(B) getCode()
(C) getFile()
(D) getLine()
(B) array_search()
(C) array_shift()
(D) array_slice()
24) Which of the following magic constant of PHP returns full path and filename of B
the file?
(A) _LINE_
(B) _FILE_
(C) _FUNCTION_
(D) _CLASS_
5 P.T.O.
25) The data is visible to ____ when you use the $_GET variable to collect data C
(A) none
(C) everyone
27) When you want to store user data in a session use the ____array. A
(A) $_SESSION
(B) SYS_SESSION
(C) $SESSION
(D) $_SESSIONS
(B) 1
(C) Error
(D) 5
29) Sticky forms are forms in which the results of a query are accompanied by a A
search from whose default values are those previous query.
(A) True
(B) False
6
30) Which of the functions is used to sort an array in descending order? C
(A) asort()
(B) sort()
(C) rsort()
(D) dsort()
31) Which of the following type of variables are instances of programmer defined C
classes?
(A) Strings
(B) Arrays
(C) objects
(D) Resources
7 P.T.O.
34) <?php A
$name = array("TANU", "CHUNNU", "MANU");
sort($name);
?>
(D) No output
(B) 3
(C) 4
(D) 5
(B) array_change_key_case()
(C) array_chunk()
(D) array_count_values()
(B) is_uploaded_file()
(C) file_uploaded(“filename”)
(D) uploaded_file(“filename”)
8
39) In PHP, each statement must be end with ______ B
(A) . (dot)
(B) ; (semicolon)
(C) / (slash)
(D) : (colon)
40) Which of the following provides access to the uploaded file in the temporary A
directory on the web server?
(A) $_FILES['file']['tmp_name']
(B) $_FILES['file']['name']
(C) $_FILES['file']['size']
(D) $_FILES['file']['type']
(B) .xml
(C) .php
(D) .ph
43) Which of the following magic constant of PHP returns class name? D
(A) _LINE_
(B) _FILE_
(C) _FUNCTION_
(D) _CLASS_
9 P.T.O.
44) Which variable is used to collect form data sent with both the GET and POST D
methods?
(A) BOTH
(B) $_BOTH
(C) $REQUEST
(D) $_REQUEST
(B) Client-side
(C) Middle-side
(D) Out-side
(C) * (Asterisk)
(D) $ (Dollar)
49) Which of the following method connect a MySql database using PHP? A
(A) mysql_connect()
(B) mysql_query()
(C) mysql_close()
10
50) PHP is a case sensitive A
(A) True
(B) False
(B) \n
(C) /n
(D) /r
(A) True
(B) Fasle
(B) Global
(C) Static
(D) Extern
(D) MIN
11 P.T.O.
56) Which of the following statements invoke the exception class? B
(A) throws new Exception();
(B) throw new Exception();
(C) new Exception();
(D) new throws Exception();
(B) False
60) Which functions in PHP is used to get the length of string variable? C
(A) Count()
(B) strcount
(C) strlens
(D) len
61) The practice of separating the user from the true inner workings of an application C
through well-known interfaces is known as _________
(A) Polymorphism
(B) Inheritance
(C) Encapsulation
(D) Abstraction
12
62) The practice of creating objects based on predefined classes is often referred to D
as
(A) class creation
(B) object creation
(C) object instantiation
(D) class instantiation
63) Which one of the following property scopes is not supported by PHP? A
(A) friendly
(B) final
(C) public
(D) static
64) Which one of the following is the right way to invoke a method?
(A) $object->methodName();
(B) object->methodName();
(C) object::methodName();
(D) $object::methodName();
65) Which of the following advanced OOP features is/are not supported by PHP? C
i) Method overloading
iii) Namespaces
(A) i)
(B) ii)
66) If your object must inherit behaviour from a number of sources you must use a/an A
(A) Interface
(B) Object
(C) Abstract class
(D) Static class
67) You can the exception base class, but you cannot override any of the preceding B
methods because the are declared as
(A) protected
(B) final
(C) static
(D) private
13 P.T.O.
68) Which one of the following databases has PHP supported almost since the D
beginning?
(A)Oracle Database
(B)SQL
(C)SQL+
(D)MySQL
70) Which one of the following methods can be used to diagnose and display C
information about a MySQL connection error?
(A) connect_errno()
(B) connect_error()
(C) mysqli_connect_errno()
(D) mysqli_connect_error()
71) Which one of the following methods is responsible for sending the query to the A
database?
(A) query()
(B) send_query()
(C) sendquery()
(D) query_send()
72) Which of the methods are used to manage result sets using both associative and C
indexed arrays?
14
73) Which one of the following method is used to retrieve the number of rows affected B
by an INSERT, UPDATE, or DELETE query?
(A) num_rows()
(B) affected_rows()
(C) changed_rows()
(D) new_rows()
75) Which of the following statements is/are true about Constructors in PHP? C
i) PHP 4 introduced class constructors.
iii) Constructors can call class methods or other functions iv) Class constructors
can call on other constructors.
(B) Tightly
(C) client
(D) server
15 P.T.O.
77) PHP recognizes constructors by the name. D
(A) classname()
(B) _construct()
(B) .
(C) ^
(D) _
79) In PHP compare two string which of the following function can you use? D
(A) strcmp()
(B) strcasecmp()
(B) Associative
(C) Multidimensional
81) Which array function checks if the specified key exists in the array B
(A) array_key_exist()
(B) array_key_exists()
(C) array_keys_exists()
(D) arrays_key_exists()
16
82) Which of the following is/are a PHP code editor? B
1. Notepad
2. Notepad++
3. Adobe Dreamweaver
4. PDT
(A) Only 4
(C) 1, 2 and 3
(D) Only 3
83) Which of the following PHP functions can be used for generating unique ids? A
A)uniqueid()
B)id()
C)md5()
D)mdid()
"Hello World"
?>
(A) Error
(C) Nothing
17 P.T.O.
85) What will the following script output? A
<?php
$sum = 0;
$sum += $array[$array[$i]];
echo $sum;
?>
(A) 78
(B) 19
(C) NULL
(D) 5
86) <?php A
# echo "Hello world";
?>
(D) Error
(B) False
18
88) Which of the following type of variables are whole numbers, without a decimal A
point, like 4195?
(A) Integers
(B) Doubles
(C) Booleans
(D) Strings
(B) unset()
(C) unlink()
(D) delete();
90) All php classes come with a default constructor that takes ____ arguments. D
(A) one
(B) two
(C) three
(D) no
(C) none
92) Which one of the following function finds the last occurrence of a string returning D
its numerical position?
(A) strlastpos()
(B) strpos()
(C) strlast()
(D) strrpos()
19 P.T.O.
93) String values must be enclosed in.............. C
(A) single quotes
(D) none
(B) $ask
(C) $request
(D) $post
$num = 1;
$num1 = 2;
?>
(A) 3
(B) 1+2
(C) 1.+.2
(D) Erro
(B) Fields
(C) Attributes
20
97) Which of the following is invalid PHP code? C
(A) $_20
(B) &$myVar
(C) $20_var
(D) ${"var"}
(B) COBOL
(C) FORTRAN
(D) .Net
?>
(A) int(13)
(B) char(14)
(C) int(14)
(D) int(15)
(B) OutOfRangeException
(C) OverflowException
(D) UnderflowException
**********
21 P.T.O.
Subject Name- Internet Programming using PHP A
& N
Paper Code- UG-CS-323 S
1 What does PHP stand for? d
i) Personal Home Page
ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor
iv) Preprocessor Home Page
a) Both i) and iii)
b) Both ii) and iv)
c) Only ii)
d) Both i) and ii)
2 PHP files have a default file extension of_______ c
a) .html
b) .xml
c) .php
d) .ph
3 What should be the correct syntax to write a PHP code? c
a) < php >
b) < ? php ?>
c) <? ?>
d) <?php ?>
4 Which version of PHP introduced Try/catch Exception? d
a) PHP 4
b) PHP 5
c) PHP 6
d) PHP 5 and later
5 How should we add a single line comment in our PHP code? c
i) /?
ii) //
iii) #
iv) /* */
a) Only ii)
b) i), iii) and iv)
c) ii), iii) and iv)
d) Both ii) and iv)
6 Which of the following PHP statement/statements will store 111 in variable num? c
i) int $num = 111;
ii) int mum = 111;
iii) $num = 111;
iv) 111 = $num;
a) Both i) and ii)
b) i), ii), iii) and iv)
c) Only iii)
d) Only i)
7 What will be the output of the following PHP code? b
<?php
$num = 1;
$num1 = 2;
print $num . "+". $num1;
?>
a) 3
b) 1+2
c) 1.+.2
d) Error
8 Which is the right way of declaring a variable in PHP? d
i) $3hello
ii) $_hello
iii) $this
iv) $This
a) Only ii)
b) Only iii)
c) ii), iii) and iv)
d) ii) and iv)
9 What will be the output of the following PHP code? c
<?php
$foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>
a) Error
b) My name is BobBob
c) My name is BobMy name is Bob
d) My name is Bob Bob
10 What will be the output of the following PHP code? c
<?php
$total = "25 students";
$more = 10;
$total = $total + $more;
echo "$total";
?>
a) Error
b) 35 students
c) 35
d) 25 students
11 Which statement will output $x on the screen? a
\
iii) .function()
iv) $function()
a) Only i)
b) Only ii)
c) i) and ii)
d) iii) and iv)
16 What will be the output of the following PHP code? c
<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
b();
a();
?>
a) I am b
b) I am bI am a
c) Error
d) I am a Error
17 Which one of the following PHP functions can be used to find files? d
a) glob()
b) file()
c) fold()
d) get_file()
18 Which one of the following functions can be used to compress a string? d
a) zip_compress()
b) zip()
c) compress()
d) gzcompress()
19 What will be the output of the following PHP code? d
<?php
echo chr(52);
?>
a) 1
b) 2
c) 3
d) 4
20 ___________ c
a) 1
b) 2
c) 0
d) -1
21 Which of the following are correct ways of creating an array? a
i) state[0] = "karnataka";
ii) $state[] = array("karnataka");
iii) $state[0] = "karnataka";
iv) $state = array("karnataka");
a) iii) and iv)
b) ii) and iii)
c) Only i)
d) ii), iii) and iv)
22 What will be the output of the following PHP code? d
<?php
$fruits = array ("apple", "orange", array ("pear", "mango"),
"banana");
echo (count($fruits, 1));
?>
a) 3
b) 4
c) 5
d) 6
23 The practice of separating the user from the true inner workings of an application c
through well-known interfaces is known as _________
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction
24 Which of the following term originates from the Greek language that means b
characteristics?
a) Abstraction
b) Polymorphism
c) Inheritance
d) Differentia
25 The practice of creating objects based on predefined classes is often referred to d
as ______________
a) class creation
b) object creation
c) object instantiation
d) class instantiation
26 Which one of the following property scopes is not supported by PHP? a
a) friendly
b) final
c) public
d) static
27 Which one of the following is the right way to define a constant? d