?
What will be the output of the following PHP code?
What will be the output of the following PHP code?
<?php
$line = "You like dogs. I hate dogs. We should marry."
$sen = preg_split('/./', $line);
print_r($sen);
?>
<?php
$line = "You like dogs. I hate dogs. We should marry."
$sen = preg_split('/./', $line);
print_r($sen);
?>
Answer & Solution
Correct Answer:
Option
C
We use a ‘.’ period to split the data, therefor giving each sentence it’s own array entry.
Join the Discussion
Login to post a comment or share your explanation.
Login