Vidyalelo
PHP · Q28

Regular Expressions

Programming · PHP · question 28

Q28

What will be the output of the following PHP code?

A.
You like dogs. I hate dogs. We should marry.
B.
Array([0]=>You like dogs. I hate dogs. We should marry.)
C.
Array([0]=>You like dogs. [1]=>I hate dogs. [2]=>We should marry.)
Answer
D.
Error

Answer: Option C

Solution

Answer: Option C
Solution:
We use a ‘.’ period to split the data, therefor giving each sentence it’s own array entry.