1.  Which of the following PCRE regular expressions best matches the string php|architect ?


*
...|.........
[a-z][a-z][a-z]\|\w{9}
[az]{3}\|[az]{9}


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

2.  [:alpha:] can also be specified as.


[A-Za-z0-9]
[A-za-z]
[A-z]
[a-z]


Answer

 Option

[:alpha:] is nothing but Lowercase and uppercase alphabetical characters.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

3.  What will be the output of the following PHP code ?
$text = ‘‘this is\tsome text that\nwe might like to parse.’‘;
print_r(split(‘‘[\n\t]’‘,$text));
?>


this is some text that we might like to parse.
Array ( [0] => some text that [1] => we might like to parse. )
Array ( [0] => this is [1] => some text that [2] => we might like to parse. )
[0] => this is [1] => some text that [2] => we might like to parse.


Answer

 Option

The split() function divides a string into various elements, with the boundaries of each element based on the occurrence of a defined pattern within the string.

Workspace

Answer Workspace Report

4.  What is the best all-purpose way of comparing two strings ?


Using the strpos function
Using the == operator
Using strcasecmp()
Using strcmp()


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

5.  What will be the output of the following PHP code ?
$username = ‘‘jasoN’‘;
if (ereg(‘‘([^a-z])’‘,$username))
echo ‘‘Username must be all lowercase!’‘;
else
echo ‘‘Username is all lowercase!’‘;
?>


Error
Username must be all lowercase!
Username is all lowercase!
No Output is returned


Answer

 Option

Because the provided username is not all lowercase, ereg() will not return FALSE (instead returning the length of the matched string, which PHP will treat as TRUE), causing the message to output.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report