MCQs>IT & Programming>Regular Expressions With PHP Test>Analyze the following code snippet that uses the preg_replace() PHP Regular Expression method: < ?php $string = 'This is the {_FOO_} brought to you by {_BAR_}'; $template_vars=array('FOO' => 'The PHP Way', 'BAR' => 'PHPro.orG'); $string = preg_replace('/{_(.*?)_}/ime', '\$template_vars['$1']',$string); echo $string; ?> What will be the output of the above code?
Regular Expressions With PHP Test MCQs
Analyze the following code snippet that uses the preg_replace() PHP Regular Expression method:
<?php
$string = 'This is the {_FOO_} brought to you by {_BAR_}';
$template_vars=array("FOO" => "The PHP Way", "BAR" => "PHPro.orG");
$string = preg_replace("/{_(.*?)_}/ime", "\$template_vars['$1']",$string);
echo $string;
?>
What will be the output of the above code?
Answer
Correct Answer: This is the The PHP Way brought to you by PHPro.orG
Explanation:
Note: This Question is unanswered, help us to find answer for this one
Regular Expressions With PHP Test Skill Assessment