Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Developed By Robin Kumar Paul
- * Email: robin@ieee.org
- * */
- if (isset($_REQUEST['input'])) {
- $ins = $_REQUEST['input'];
- $ins = explode("\n", $ins);
- $output = "";
- print_r($ins);
- foreach ($ins as $key => $char) {
- if ($key == 0) continue;
- $bal = "NO";
- if ($char == "" || strpos($char, " ") || strpos($char, ":)") || strpos($char, ":(") || strpos($char, ":") || preg_match("/[A-Za-z]/", $char)) {
- $bal = "YES";
- }
- if ($bal == "NO") {
- $n = 0;
- for ($i = 0; $i < strlen($char); $i++) {
- if ($char[$i] == ")") {
- $n--;
- }
- if ($char[$i] == "(") {
- $n++;
- }
- if ($n < 0) {
- break;
- }
- }
- if ($n == 0) {
- $bal = "YES";
- }
- }
- $output = $output . "Case #" . $key . ": " . $bal . "<br>";
- }
- echo "<h3>Output</h3>";
- echo $output;
- }
- ?>
- <h2>Input</h2>
- <form action="" method="post">
- <textarea rows="10" cols="100" name="input"></textarea>
- <input type="submit" value="Submit To Hack"/>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement