PHP, select a string between two strings, then get one value from the selected string
<p>I have a file, with many parts of code.
Each part starts with <code>&lt;form&gt;</code> and ends with <code>&lt;/form&gt;</code>.
Between each form, there is something like this: <code>&lt;input type='text' name='date' value='2010-01-01'&gt;&lt;input type='text' name='username' value='test'&gt;</code></p>

<p>I want to parse each part of the code with php and get the value of input username, where the value for input date is '2010-01-01'</p>

<p>Any solutions please?</p>

<p>example:</p>

<pre><code>&lt;form&gt;
&lt;input type='text' name='date' value='2010-01-01'&gt;
&lt;input type='text' name='username' value='test'&gt; &lt;!-- How can I get this value ('test')? --&gt;
&lt;/form&gt;
&lt;form&gt;
&lt;input type='text' name='date' value='2010-01-02'&gt;
&lt;input type='text' name='username' value='test2'&gt;
&lt;/form&gt;
.
.
.
</code></pre>
