Time remaining
:
:
Test Status
PHPTEST2
Ques 1 :
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 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 :
Given a comma-separated list of values in a string, which function from the given list can create an array of each individual value with a single call?
(A) strstr()
(B) strtok()
(C) explode()
(D) extract()
Ques 4 :
What is the best all-purpose way of comparing two strings?
(A) Using the strpos function
(B) Using the == operator
(C) Using strcasecmp()
(D) Using strcmp()
Ques 5 :
Which of the following PCRE regular expressions best matches the string php|architect?
(A) \d{3}\|\d{8}
(B) [a-z][a-z][a-z]\|\w{9}
(C) [az]{3}\|[az]{9}
(D) .*
Ques 6 :
Which of the following functions can be used to determine the integrity of a string?
(A) md5()
(B) sha1()
(C) crc32()
(D) all of the above
Ques 7 :
What happens if you add a string to an integer using the + operator?
(A) The interpreter outputs a type mismatch error
(B) The string is converted to a number and added to the integer
(C) The string is discarded and the integer is preserved
(D) The integer and string are concatenated together in a new string
Ques 8 :
The ___________ function can be used to compare two strings using a case-insensitive binary algorithm ?
(A) strcmp()
(B) stricmp()
(C) strcasecmp()
(D) stristr()
Ques 9 :
Which of the following functions can be used to convert the binary data stored in a string into its hexadecimal representation?
(A) encode_hex()
(B) pack()
(C) hex2bin()
(D) bin2hex()
Ques 10 :
^[A-Za-z].* matches
(A) play it again
(B) I
(C) both (A) and (B)
(D) 123
Ques 11 :
^[0-9]{5}(\-[0-9]{4})?$ matches
(A) 9001 and 12-4321\
(B) 90001 and 90002-4323
Ques 12 :
How do you get information from a form that is submitted using the "get" method?
(A) $_GET[];
(B) Request.Form;
(C) Request.Query String;
(D) .$_POST[];
Ques 13 :
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 14 :
PHP code is embedded directly into XHTML document?
(A) False
(B) True
Ques 15 :
Is it possible to submit a form with out a submit button?
(A) Yes
(B) No
Ques 16 :
What is the out put ?
<?php $x=array("aaa","ttt","www","ttt","yyy","tttt"); $y=array_count_values($x); echo $y[ttt]; ?>
(A) 2
(B) 3
(C) 1
(D) 4
Ques 17 :
In php Which method is used to getting browser properties?
(A) $_SERVER['PHP_SELF']
(B) $_SERVER['HTTP_VARIENT']
(C) $_SERVER['HTTP_USER_AGENT'];
(D) $_SERVER['SERVER_NAME']
Ques 18 :
What is the expansion of LAMP?
(A) Linux And Mysql Php
(B) Linux Apache Mysql Php
Ques 19 :
What is the output ?
<?php $x=array(1,3,2,3,7,8,9,7,3); $y=array_count_values($x); echo $y[8]; ?>
(A) 43
(B) 1
(C) 6
(D) 8
Ques 20 :
Which of the following function is used to pick one or more random values from PHP Array?
(A) array_random()
(B) Rand_array()
(C) array_rand()
(D) Random_array()
Submit Answer
Don't Refresh the Page !! ...