Regular Expressions - PHP quiz 1

By CareerCadets

Regular Expressions - PHP Online Quiz 1

Regular Expressions - PHP quiz 1 is a free online quiz challenge under Regular Expressions - PHP category. There are 40 free online quiz challenges available in PHP category


What will be the output of the following PHP code?

<?php
echo str_pad("Salad", 5)." is good.";
?>

Which one of the following is not a preg PHP function?

What will be the output of the following PHP code?

<?php
$str = "Hello! My name is Cameron Fox. Coffee?"
$find = array('/is/','/coffee/');
$replace = array('/was/','/tea/');
echo preg_replace ($find, $replace, $str);
?>

PHP has long supported two regular expression implementations known as _______ and _______. 1. Perl 2. PEAR 3. Pearl 4. POSIX

What will be the output of the following PHP code?

<?php
$foods = array("pasta", "steak", "fish", "potatoes");
$food = preg_grep("/^s/", $foods);
print_r($food);
?>

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));
?>

Which one of the following preg PHP function is used to do a find and replace on a string or an array?

POSIX stands for

Parameter flags was added in which version of PHP?

POSIX implementation was deprecated in which version of PHP?

Invite your friends to Regular Expressions - PHP quiz 1 Quiz

gmail WhatsApp Facebook Twitter Outlook Linkedin