using php how can i scrape all fields names and output to a text file?
<p>what i want to try to do is be able to enter say a url onto a variable and once executed the page will scrape all input field names and export it to a text file.</p>

<p>for example.</p>

<p>if i have  </p>

<pre><code>&lt;input type="text" name="firstname"&gt;
&lt;input type="text" name="lastname"&gt;
&lt;select name="sex"&gt;
&lt;option&gt;...&lt;/option&gt;
...
&lt;/select&gt;

the output would be

firstname
lastname
sex
</code></pre>

<p>whats a simple way of doing it?</p>

<p>thanks</p>
