Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form method="post" autocomplete="off">
- <textarea id="wiyetxt" name="input"></textarea>
- <input type="submit" value="Send">
- <input type="reset" value="Clear">
- </form>
- $input = $_POST["input"];
- $keywords = ["apple" => "Found 'apple'", "banana" => "Found 'banana'",
- "carrot" => "Found 'carrot'"];
- if ($input contains one of these keys) {
- alert(value which corresponds to the key);
- }
- else {
- alert("No keys were found")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement