Add the modifier "s" to the regex:
If this modifier is set, a dot metacharacter in the pattern matches
all characters, including newlines. Without it, newlines are excluded.
This modifier is equivalent to Perl's /s modifier. A negative class
such as [^a] always matches a newline character, independent of the
setting of this modifier.
$fruits = "One
Two
Three";
preg_match_all('/^(.*)$/s', $fruits, $matches);
print_r($matches);
Update:
If you enclose $fruits in single quotes, the newline isn't treated as such and the replacement also works, event without the "s" modifier. But I don't know if the output is what you expect it to be ;)
$fruits = 'One
Two
Three';
preg_match_all('/^(.*)$/', $fruits, $matches);
print_r($matches);