Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>HTML tag</title>
- </head>
- <body bgcolor="#99ffcc">
- <h2>HTML вложен двоен таг валидатор</h1>
- <form action="#" method="post">
- <label for="html">HTML тагове: </label>
- <input type="text" name="html">
- <input type="submit" name="validate" value="Валидирай">
- </form>
- <?php
- if (isset($_POST["validate"])){
- $htmlt = $_POST["html"];
- $regEx = "/<([^>]+)>.*<([^>]+)>.*<\/\\2>.*<\/\\1>/";
- if (preg_match($regEx, $htmlt)){
- echo "<p> Валиден </p>";
- } else {
- echo "<p> Невалиден </p>";
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement