Time remaining
:
:
Test Status
PHPRANDOMTEST
Ques 1 :
what is the return value of this substr function?
<?php
$rest = substr("abcdef", -1);
$rest = substr("abcdef", 0, -1);
?>
(A) f,abcde
(B) b,abcdef
(C) a,fedcb
(D) a,abcde
Ques 2 :
Given a variable $email containing the string user@example.com, which of the following statements would extract the string example.com?
(A) substr($email, strpos($email, "@"));
(B) strstr($email, "@");
(C) strchr($email, "@");
(D) substr($email, strpos($email, "@")+1);
Ques 3 :
In mail($param1, $param2, $param3, $param4), the $param2 contains
(A) The message
(B) The header
(C) The recipient
(D) The subject
Ques 4 :
A variable $word is set to "HELLO WORLD", which of the following script returns in title case?
(A) echo ucwords($word.)
(B) echo ucfirst($word).
(C) echo ucwords(strtolower($word).
(D) echo ucfirst(strtolower($word).
Ques 5 :
Which of the following will not combine strings $s1 and $s2 into a single string?
(A) $s1 + $s2
(B) "{$s1}{$s2}"
(C) $s1.$s2
(D) implode(' ', array($s1,$s2))
Ques 6 :
How would you add 1 to the variable $count?
(A) incr count;
(B) $count++;
(C) $count =+1
(D) incr $count;
Ques 7 :
Trace the function that does continue the script execution even if the file inclusion fails
(A) include ()
(B) require ()
(C) both of above
(D) None of above
Ques 8 :
Which of the following mode of fopen() function opens a file only for writing. If a file with that name does not exist, attempts to create anew file. If the file exist, place the file pointer at the end of the file after all other data.
(A) W
(B) W+
(C) A
(D) A+
Ques 9 :
The left associative dot operator (.) is used in PHP for
(A) multiplication
(B) separate object and its member
(C) concatenation
(D) delimiter
Ques 10 :
On failure of which statement the script execution stops displaying error/warning message?
(A) include ()
(B) require ()
(C) both of above
(D) None of above
Ques 11 :
What is the out put
<?php
$father="mother";
$mother="son";
echo $$father;
?>
(A) son
(B) mother
(C) motherson
(D) error
Ques 12 :
Which function includes the specified file even the statement evaluates to false in which block the function is placed.
(A) include ()
(B) require ()
(C) both of above
(D) None of above
Ques 13 :
what will be the output of below code ?
<?php
$x=array(2=>"mouse",7=>"keyboard");
$y=array_keys($x);
echo $y[1];
?>
(A) 2
(B) 7
(C) keyboard
(D) mouse
Ques 14 :
Full form of PHP.
(A) PreHypertextProcessor
(B) HypertextPreprocessor
(C) Hypertext Postprocessor
(D) PostHypertextProcessor
Ques 15 :
Trace the false statement
(A) Because the included code will be embedded in a PHP execution block, the PHP execution block, the PHP escape tags ( aren't required on the file to be includeD.
(B) Any code found within an included file will inherit the variable scope of the location of its caller
(C) For the inclusion of remote files the allow-url-pope must be enabled ad URL wrapper must be supported
(D) Including a file produces the same result as copying the data from the file specified into the location in which the statement appears.
Ques 16 :
On failure of which statement the script execution stops displaying error/warning message?
(A) reinclude ()
(B) require ()
(C) both of above
(D) None of above
Ques 17 :
What is the out put
<?php
$x=array(4,2,5,1,4,5,3,4);
$y=array_count_values($x);
echo count($y);
?>
(A) 8
(B) 7
(C) 5
(D) 28
Ques 18 :
What's the best way to copy a file from within a piece of PHP?
(A) Print out a message asking your user to "telnet" in to the server and copy the file for you
(B) Open the input and output files, and use read() and write() to copy the data block by block until read() returns a zero
(C) Use the built in copy() function
(D) Use "exec" to run an operating system command such as cp (Unix, Linux) or copy (Windows)
Ques 19 :
What's the best way to copy a file from within a piece of PHP?
(A) out a message asking your user to "telnet" in to the server and copy the file for you
(B) Open the input and output files, and use read() and write() to copy the data block by block until read() returns a zero
(C) Use the built in copy() function
(D) Use "exec" to run an operating system command such as cp (Unix, Linux) or copy (Windows)
Ques 20 :
script is a ______.
(A) Program or sequence of instruction that is interpreted or carried out by web server only
(B) Program or sequence of instruction that is interpreted or carried out by another program
(C) Program or sequence of instructions that is interpreted or carried out by processor directly
(D) None of above
Submit Answer
Don't Refresh the Page !! ...