title: Creating a CSV file from an HTML page
body: <p>I have extracted records from a database and stored them on an HTML page with only text. Each record is stored in a <code>&lt;p&gt;</code> paragraph field and separated by a line break <code>&lt;br /&gt;</code> and a line &lt;<code>hr&gt;</code>. 
  For example:</p>
  
  <pre><code>Company Name&lt;br/&gt;
  555-555-555&lt;br /&gt;
  Address Line 1&lt;br /&gt;
  Address Line 2&lt;br /&gt;
  Website: www.example.com&lt;br /&gt;
  </code></pre>
  
  <p>I just need to place these records into a CSV file. I used <strong>fputcsv</strong> in combination with array() and file_get_contents() but it read my the entire source code of the webpage into a .csv file and alot of data was missing as well. These are multiple records stored in the same format. So after an entire record block as seen above, it is separate by an <code>&lt;hr&gt;</code> line tag. I want to read the company name into the Name column, the Phone number into the Phone column, the addresses into the Address column and the Website into the Website column as shown below.</p>
  
  <p><a href="http://i.stack.imgur.com/00Gxw.png" rel="nofollow">http://i.stack.imgur.com/00Gxw.png</a>
  <br />How can i do this?</p>
  
  <p>Snippet of the HTML:<br /></p>
  
  <pre><code>            1 Stop Signs&lt;br /&gt;
              480-961-7446&lt;br /&gt;
  500 N. 56th Street&lt;br /&gt;
          Chandler, AZ  85226&lt;br /&gt;
  
  &lt;br /&gt;
                  Website: www.1stopsigns.com&lt;br /&gt;
              &lt;br /&gt;
              &lt;/p&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;
  </code></pre>
  
  <p>It's spaced like this in the source of the HTML.</p>