Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_GET['text'])) {
- $text = $_GET['text'];
- preg_match_all('/\w+/', $text, $words);
- $words = $words[0];
- $upperWords = array_filter($words, function ($word){
- return strtoupper($word) == $word;
- });
- echo implode(', ',$upperWords);
- }
- ?>
- <form>
- <textarea rows="10" name="text"><?=$upperWords?></textarea><br>
- <input type="submit" value="Extract">
- </form>
Add Comment
Please, Sign In to add comment