PHP Test And solutions
Question.11.
which of the following are used for code reuse?
a. Loops
b. functions
c. Database
d. include files
Solution:
B,D
Question.13.
which of the following is the corect way of specifying default value?
a. Function GetDiscount($Type = "Special") {.........}
b. Function GetDiscount(Type := "Special") {.........}
c. Function GetDiscount($Type: = "Special") {.........}
d. Function GetDiscount($Type : "Special") {.........}
Solution:
Question.14.
Which of the following are ''magic constant'?
a. __LINE__
b. __FILE__
c __PRETTY_FUNCTION__
d __CLASS__
e. __METHOD__
Solution:
Question.15.
you have defined three variables $to, $subject, and $body to send an email. Which of the following methods would you use for sending an email?
a. mail($to, $subject,$body)
b. sendmail($to, $subject,$body)
c. mail(to, subject,body)
d. sendmail(to, subject,body)
Solution:
Question.16.
Which one of the following is turnary operator?
a. &
b. =
c. :?
d. ?:
e. +=
f. &&
Solution
D
Question.17.
What is the result of the following Exprssion?
5+2*4+6
a. 70
b. 19
c. 34
d. 21
Solution:
B
Question.18.
The default value of register global in PHP is:
a. Off
b. On
Solution:
A
Question.19.
What would b the outpur of the following code?
$string = 'good day';
$string = ucword($string);
echo $string;
?>
a. good day
b. GOOD DAY
c. Good Day
d. non of the above
Solution:
C
Question.20.
If you want to pass a value to a function by reference, the correct way is:
a. function ModifyReport(&$Rptfile){}
b. function ModifyReport($Rptfile){}
c. function ModifyReport(ByRef $Rptfile){}
d. function ModifyReport(&Rptfile){}
Solution:
D
Question.11.
which of the following are used for code reuse?
a. Loops
b. functions
c. Database
d. include files
Solution:
B,D
Question.13.
which of the following is the corect way of specifying default value?
a. Function GetDiscount($Type = "Special") {.........}
b. Function GetDiscount(Type := "Special") {.........}
c. Function GetDiscount($Type: = "Special") {.........}
d. Function GetDiscount($Type : "Special") {.........}
Solution:
Question.14.
Which of the following are ''magic constant'?
a. __LINE__
b. __FILE__
c __PRETTY_FUNCTION__
d __CLASS__
e. __METHOD__
Solution:
Question.15.
you have defined three variables $to, $subject, and $body to send an email. Which of the following methods would you use for sending an email?
a. mail($to, $subject,$body)
b. sendmail($to, $subject,$body)
c. mail(to, subject,body)
d. sendmail(to, subject,body)
Solution:
Question.16.
Which one of the following is turnary operator?
a. &
b. =
c. :?
d. ?:
e. +=
f. &&
Solution
D
Question.17.
What is the result of the following Exprssion?
5+2*4+6
a. 70
b. 19
c. 34
d. 21
Solution:
B
Question.18.
The default value of register global in PHP is:
a. Off
b. On
Solution:
A
Question.19.
What would b the outpur of the following code?
$string = 'good day';
$string = ucword($string);
echo $string;
?>
a. good day
b. GOOD DAY
c. Good Day
d. non of the above
Solution:
C
Question.20.
If you want to pass a value to a function by reference, the correct way is:
a. function ModifyReport(&$Rptfile){}
b. function ModifyReport($Rptfile){}
c. function ModifyReport(ByRef $Rptfile){}
d. function ModifyReport(&Rptfile){}
Solution:
D
Question.21.
What will be the output of the following code?
$a = 10;
echo "Value of a = $a";
a. value of a = 10
b. Value of a = $a
c. Undefind
d. Syntax Error
Solution:
A
Question.22.
Which of the following regualr expressions can be used to check the validity of an email address?
a. ^[^@]+@[^@]+\[^@]+$
b. ^[^@]+@[^@]+[^@]+$
c. $[^@]+@[^@]+\[^@]+^
d. $[^@]+@[^@]+.[^@]+^
Solution:
Question.23.
Which of the following is not represent logical AND operator in PHP?
a. &
b. &&
c. And
d. AND
Solution:
A
Question.24.
Which of the following are file PHP file Upload Related function?
a. upload_file()
b. is_upload_file()
c. move_upload_file()
d. Non of the above
Solution:
D
Question.25.
Does PHP support exceptions?
a. Yes
b. No
Solution:
A
Question.26.
Which of the following functions do you need to implement HTTP Basic Authentication?
a. Authenticate()
b. header()
c. basic_auth()
d. Non of the above
Solution:
D
Question.27.
What will be the output of the following code?
for ($i = 0; $i <>
{if($i == 2)
continoue;
print "$i\n";
}
?>
a. 0
1
2
3
4
5
b. 0
1
2
3
4
c. 2
d. 0
1
2
4
e. non of the above
Solution:
B
Question.28.
What will be the output of the following code?
echo 12 . 6;
a. 12 . 6
b. 126
c. 12.6
d. Error: You cannot add integers through the concatienation operator(.)
Solution:
Question.29.
Which of the following is not supported in PHP5?
a. Type Hinting
b. Reflection
c. Magic Methods
d. Object Cloning
Solution:
Question.30.
Which of the following are valid PHPdata types?
a. resource
b. null
c. boolean
d. string
e. Both a and c
f. b, c and d
g. All of the above
Solution:
What will be the output of the following code?
$a = 10;
echo "Value of a = $a";
a. value of a = 10
b. Value of a = $a
c. Undefind
d. Syntax Error
Solution:
A
Question.22.
Which of the following regualr expressions can be used to check the validity of an email address?
a. ^[^@]+@[^@]+\[^@]+$
b. ^[^@]+@[^@]+[^@]+$
c. $[^@]+@[^@]+\[^@]+^
d. $[^@]+@[^@]+.[^@]+^
Solution:
Question.23.
Which of the following is not represent logical AND operator in PHP?
a. &
b. &&
c. And
d. AND
Solution:
A
Question.24.
Which of the following are file PHP file Upload Related function?
a. upload_file()
b. is_upload_file()
c. move_upload_file()
d. Non of the above
Solution:
D
Question.25.
Does PHP support exceptions?
a. Yes
b. No
Solution:
A
Question.26.
Which of the following functions do you need to implement HTTP Basic Authentication?
a. Authenticate()
b. header()
c. basic_auth()
d. Non of the above
Solution:
D
Question.27.
What will be the output of the following code?
for ($i = 0; $i <>
{if($i == 2)
continoue;
print "$i\n";
}
?>
a. 0
1
2
3
4
5
b. 0
1
2
3
4
c. 2
d. 0
1
2
4
e. non of the above
Solution:
B
Question.28.
What will be the output of the following code?
echo 12 . 6;
a. 12 . 6
b. 126
c. 12.6
d. Error: You cannot add integers through the concatienation operator(.)
Solution:
Question.29.
Which of the following is not supported in PHP5?
a. Type Hinting
b. Reflection
c. Magic Methods
d. Object Cloning
Solution:
Question.30.
Which of the following are valid PHPdata types?
a. resource
b. null
c. boolean
d. string
e. Both a and c
f. b, c and d
g. All of the above
Solution:
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন