Yes, the modifier s, also known as the dotall modifier, causes the dot to .also match newlines.
Your regex is being used correctly, and this seems to work for me.
$text = <<<DATA
this is a test
another line
DATA;
preg_match('/test.*another/si', $text, $match);
echo $match[0];
See here demo.
Exit
test
another
source
share