Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- mb_internal_encoding("utf-8");
- header('Content-Type: text/html; charset=utf-8');
- $text = htmlspecialchars($_GET['text']);
- $word = htmlspecialchars($_GET['word']);
- $pattern = "/[^\.\?\!\s][^\.\?\!]*\s".$word."\s[^\.\?\!]*[\.\?\!]/";
- preg_match_all($pattern, $text, $matches);
- foreach ($matches[0] as $key => $value) {
- echo "$value <br/>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement