Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['submit'])) {
- $wordChunks = explode(" ", $_POST['somewords']);
- for($i = 0; $i < count($wordChunks); $i++){
- echo "Piece $i = $wordChunks[$i] <br />";
- }
- $wordChunksLimited = explode(" ", $_POST['somewords'], 4);
- for($i = 0; $i < count($wordChunksLimited); $i++){
- echo "Limited Piece $i = $wordChunksLimited[$i] <br />";
- }
- }
- else {
- ?>
- <form action="#" method="post">
- <input type="textfield" name="somewords" />
- <input type="submit" name="submit" value="Submit" />
- </form>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement