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));
?>
<?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.
Answer: Option D
Solution(By Examveda Team)
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.Related Questions on Regular Expressions
A. 1 and 2
B. 2 and 4
C. 1 and 4
D. 2 and 3
Join The Discussion