ExamVeda
Login
Home
This question belongs to PHP Regular Expressions
Regular Expressions
?

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

Answer & Solution
Correct Answer: Option C
We use a ‘.’ period to split the data, therefor giving each sentence it’s own array entry.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.