PHP Most IMP MCQ SET

PHP Multiple Choice Question Material
[1] How Does The Identity Operator === Compare Two Values?
(A) => It converts them to a common compatible data type and then compares the resulting values
(B) => It returns True only if they are both of the same type and value
(C) => If the two values are strings, it performs a lexical comparison
Answer =>> It converts them to a common compatible data type and then compares the resulting values
[2] Under What Circumstance Is It Impossible To Assign A Default Value To A Parameter While Declaring A Function?
(A) => When the parameter is Boolean
(B) => When the function is being declared as a member of a class
(C) => When the parameter is being declared as passed by reference
Answer =>> When the parameter is being declared as passed by reference
[3] Variables Always Start With A ........ In PHP
(A) => Pond-sign
(B) => Yen-sign
(C) => Dollar-sign
Answer =>> Dollar-sign
[4] PHP Is An Open Source Software
(A) => True
(B) => False
(C) => None
Answer =>> True
[5] Which Of The Following Is Not Valid PHP Code?
(A) => $_10
(B) => $10_somethings
(C) => ${“MyVar”}
Answer =>> $10_somethings
[6] What Is The Difference Between Print() And Echo()?
(A) => print() can be used as part of an expression, while echo() can’t
(B) => echo() can be used as part of an expression, while print() can’t
(C) => echo() can be used in the CLI version of PHP, while print() can’t
Answer =>> print() can be used as part of an expression, while echo() can’t
[7] PHP Runs On Different Platforms (Windows, Linux, Unix, Etc.)
(A) => True
(B) => False
(C) => None
Answer =>> True
[8] Which Of The Following Will Not Combine Strings $S1 And $S2 Into A Single String?
(A) => $s1 + $s2
(B) => $s1 + $s2
(C) => mplode(' ', array($s1,$s2))
Answer =>> $s1 + $s2
[9] 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) => strchr($email, "@");
(C) => substr($email, strpos($email, "@")+1);
Answer =>> substr($email, strpos($email, "@")+1);
[10] 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) => explode()
(B) => extract()
(C) => strstr()
Answer =>> explode()
[11] What Is The Best All-Purpose Way Of Comparing Two Strings?
(A) => Using strcmp()
(B) => Using strcasecmp()
(C) => Using the == operator
Answer =>> Using strcmp()
[12] Which Of The Following PCRE Regular Expressions Best Matches The String Php|Architect?
(A) => [a-z][a-z][a-z]\|\w{9}
(B) => [az]{3}\|[az]{9}
(C) => \d{3}\|\d{8}
Answer =>> [a-z][a-z][a-z]\|\w{9}
[13] Which Of The Following Functions Can Be Used To Determine The Integrity Of A String?
(A) => md5()
(B) => sha1()
(C) => Both
Answer =>> Both
[14] 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
Answer =>> The string is converted to a number and added to the integer
[15] The ___________ Function Can Be Used To Compare Two Strings Using A Case-Insensitive Binary Algorithm
(A) => strcmp()
(B) => stricmp()
(C) => strcasecmp()
Answer =>> strcasecmp()
[16] Which Of The Following Functions Can Be Used To Convert The Binary Data Stored In A String Into Its Hexadecimal Representation?
(A) => pack()
(B) => encode_hex()
(C) => printf()
Answer =>> pack()
[17] ^[A-Za-Z].* Matches
(A) => its Allows Only Alphabetics
(B) => Its Allow Only Numeric
(C) => None
Answer =>> its Allows Only Alphabetics
[18] ^[0-9]{5}(\-[0-9]{4})?$ Matches
(A) => its Allows Only Alphabetics
(B) => Its Allow Only Numeric
(C) => None
Answer =>> Its Allow Only Numeric
[19] Array Values Are Keyed By ______ Values (Called Indexed Arrays) Or Using ______ Values (Called Associative Arrays). Of Course, These Key Methods Can Be Combine

Post a Comment

Previous Post Next Post