PHP has long supported two regular expression implementations known as _______ and _______.
1. Perl
2. PEAR
3. Pearl
4. POSIX
A. 1 and 2
B. 2 and 4
C. 1 and 4
D. 2 and 3
Select an option to see the answer and solution.
Which one of the following regular expression matches any string containing zero or one p?
Select an option to see the answer and solution.
[:alpha:] can also be specified as.
A. [A-Za-z0-9]
B. [A-za-z]
C. [A-z]
D. [a-z]
Select an option to see the answer and solution.
How many functions does PHP offer for searching strings using POSIX style regular expression?
Select an option to see the answer and solution.
What will be the output of the following PHP code?
<?php
$username = "jasoN" ;
if (ereg ("([^a-z])" ,$username))
echo "Username must be all lowercase!" ;
else
echo "Username is all lowercase!" ;
?> A. Error
B. Username must be all lowercase!
C. Username is all lowercase!
D. No Output is returned
Select an option to see the answer and solution.
POSIX implementation was deprecated in which version of PHP?
A. PHP 4
B. PHP 5
C. PHP 5.2
D. PHP 5.3
Select an option to see the answer and solution.
POSIX stands for
A. Portable Operating System Interface for Unix
B. Portable Operating System Interface for Linux
C. Portative Operating System Interface for Unix
D. Portative Operating System Interface for Linux
Select an option to see the answer and solution.
What will be the output of the following PHP code?
<?php
$text = "this istsome text thatnwe might like to parse." ;
print_r (split ("[nt]" ,$text));
?> A. this is some text that we might like to parse.
B. Array ( [0] => some text that [1] => we might like to parse. )
C. Array ( [0] => this is [1] => some text that [2] => we might like to parse. )
D. [0] => this is [1] => some text that [2] => we might like to parse.
Select an option to see the answer and solution.
Which of the following would be a potential match for the Perl-based regular expression /fo{2,4}/ ?
1. fol
2. fool
3. fooool
4. fooooool
A. Only 1
B. 2 and 3
C. 1, 3 and 4
D. 1 and 4
Select an option to see the answer and solution.
Which among the following is/are not a metacharacter?
1. /a
2. /A
3. /b
4. /B
A. Only 1
B. 1 and 3
C. 2, 3 and 4
D. 2 and 4
Select an option to see the answer and solution.
How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions.
Select an option to see the answer and solution.
What will be the output of the following PHP code?
<?php
$foods = array ("pasta", "steak", "fish", "potatoes" );
f oo d =< s p an c l a ss = " p − b l u e " > p r e g g r e p < / s p an > ( " / s /" , foods);
print_r ($food);
?> A. Array ( [0] => pasta [1] => steak [2] => fish [3] => potatoes )
B. Array ( [3] => potatoes )
C. Array ( [1] => steak )
D. Array ( [0] => potatoes )
Select an option to see the answer and solution.
Say we have two compare two strings which of the following function/functions can you use?
1. strcmp()
2. strcasecmp()
3. strspn()
4. strcspn()
A. 1 and 2
B. 3 and 4
C. None of the mentioned
D. All of the mentioned
Select an option to see the answer and solution.
Which one of the following functions will convert a string to all uppercase?
A. strtoupper()
B. uppercase()
C. str_uppercase()
D. struppercase()
Select an option to see the answer and solution.
What will be the output of the following PHP code?
<?php
$title = "O'malley wins the heavyweight championship!" ;
echo ucwords ($title);
?> A. O'Malley Wins The Heavyweight Championship!
B. O'malley Wins The Heavyweight Championship!
C. O'Malley wins the heavyweight championship!
D. o'malley wins the heavyweight championship!
Select an option to see the answer and solution.
What will be the output of the following PHP code?
<?php
echo str_pad ("Salad", 5)." is good." ;
?> A. SaladSaladSaladSaladSalad is good
B. is good SaladSaladSaladSaladSalad
C. is good Salad
D. Salad is good
Select an option to see the answer and solution.
Which one of the following functions can be used to concatenate array elements to form a single delimited string?
A. explode()
B. implode()
C. concat()
D. concatenate()
Select an option to see the answer and solution.
Which one of the following functions finds the last occurrence of a string, returning its numerical position?
A. strlastpos()
B. strpos()
C. strlast()
D. strrpos()
Select an option to see the answer and solution.
What will be the output of the following PHP code?
<?php
$author = "[email protected] " ;
a u t h or < s p an c l a ss = " p − b l u e " >= s t r r e pl a ce < / s p an > ( " a " , "@" , author);
echo "Contact the author of this article at $author." ;
?> Select an option to see the answer and solution.
What will be the output of the following PHP code?
A. B. contact
C. contact@
D. examveda.com
Select an option to see the answer and solution.