i would like to read a web page ( not local ) which contains a form.
extract all the html into a variable.
then extract the form field names into an array.
i know how to open and read the file into a variable ... i am just having trouble figuring out how to make an array out of the field names.
here is an example of the page i want to read:
<html>
<body>
<form method=post action="somepage.html">
Name <input type=text name="realname"> <br>
Email <input type=text name="email"> <br>
Comments <text area name="comments"></textarea>
</form>
</body>
</html>
after opening and reading the page, i need to get the field names into an array. it would end up being like this:
<?
$field[0]="name";
$field[1]="email";
$field[2]="comments";
?>
i think this is the pattern i need to match
input=["]?[a-zA-Z_]+["]?\s
but i am not sure how i would bring all those matches into an array.
any insight would be much appreciated.
thanks!