Home »
MCQs »
PHP MCQs
What will be the output of the following PHP code (27)?
128. What will be the output of the following PHP code?
<?php
$str = "Hello, IncludeHelp";
$pattern = "/includehelp/i";
echo preg_match($pattern, $str);
?>
- 0
- 1
- 5
- 7
Answer: B) 1
Explanation:
In the above PHP script, the pattern is found in the string and the value i enables the case-insensitivity. Thus, the result will be 1.