Advertisement
azcn2503

Untitled

Apr 26th, 2014
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1.             // Forms
  2.             while(1) {
  3.                 preg_match_all('/\<form.*?\>/i', $content, $forms);
  4.                 if(sizeof($forms) == 0) { break; }
  5.                 $forms = $forms[0];
  6.                 $attributes = array('action', 'id', 'method', 'name');
  7.                 for($i = 0; $i < sizeof($forms); $i++) {
  8.                     $response['forms'][$i] = array();
  9.                     foreach($attributes as $attribute) {
  10.                         preg_match('/' . $attribute . '=(\"|\')(.*?)?(\"|\')/i', $forms[$i], $attributeMatch);
  11.                         if(sizeof($attributeMatch) == 0) { continue; }
  12.                         $response['forms'][$i][$attribute] = $attributeMatch[2];
  13.                     }
  14.                 }
  15.                 break;
  16.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement