- Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
- I would like to know what method is good to
<?php
$string = <<<TEXT
I would like to know what method is good to get the first 20 words from an english sentence. I need to analyze its subject and verb before processing further.
TEXT;
echo preg_replace('/(?:\s*\S+){10}\K.*/', '', $string);