Tuesday, April 8, 2014

Elance PHP Test Questions

Question.1:The setrawcookie() method of setting cookies is different from PHP standard method of cookie setting as:

a. It does not allow expiry time to be set
b. It can be used only once
c. It does not URL-ENCODE the value on its own
d.It does not allow domain setting


Question.2 How can you hide the fact that web pages are written in PHP?

a. By using AddType application/X-httpd-php asp
b. Specify all file names without any dot and extension
c. By using .htaccess directive in Apache
d. All of the above


Question.3 What is the output of the following code?

$a = 3;
$b = 2;
echo (int)$a/(int)$b
?>
  
a. 1
b. 1.5
c. 2
d. 3
e. Error


Question.4 Which one is correct?

a. $s = fwrite (“a string here”);
b. $s = fwrite ($fp,”a string here”);
c. $s = fwrite (“a string here”,$fp);
d. none of the above


Question.5 Which of the following set of operations is not valid in PHP 5?

a. >, >=
b. =,==
c. !==,!==
d. +=, *=


Question.6 Late PHP version support remote file accessing for the functions:

a. include()
b. include_once()
c. require_once()
d. All of the above


Question.7 What will be the output of the following script?
$count=50;
function Argument()
{
$count++;
echo $count;
}
Argument()
?>

a. It will print 50
b. It will print 51
c. It will print 52
d. It will print 1


Question.8 which of the following are used for code reuse?

a. Loops
b. functions
c. Database
d. include files


Question.9 What is the result of the following Expression?

5+2*4+6
  
a. 70
b. 19
c. 34
d. 21


Question.10 The default value of register global in PHP is:

a. Off
b. On
  

Question.11 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){}

No comments:

Post a Comment