Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Read the first 4 words of string independently the number os space between her
- $frase = "<pre>My longest text to test in my school that is very close to my village</pre>";
- preg_match('/My\s+\w+\s+\w+\s+\w+/', $frase, $result);
- print "<pre>".$result[0]."</pre>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement