title: Insert values from multiple elements with PHP into a database
body: <p>I need to save the data within these page elements into a database - they will be dynamically created by the user, but always in a similar format</p>
  
  <p>The HTML appears:</p>
  
  <pre><code>&lt;div&gt;&lt;p&gt;1&lt;/p&gt;
     &lt;div&gt;&lt;p&gt;Broccoli&lt;/p&gt;&lt;/div&gt;
     &lt;div&gt;&lt;p&gt;Carrot&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div&gt;&lt;p&gt;2&lt;/p&gt;
     &lt;div&gt;&lt;p&gt;Chicken&lt;/p&gt;&lt;/div&gt;
     &lt;div&gt;&lt;p&gt;Beef&lt;/p&gt;&lt;/div&gt;
     &lt;div&gt;&lt;p&gt;Lamb&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>values needed from this:</p>
  
  <pre><code>"1:Broccoli", "1:Carrot", "2:Chicken", "2:Beef", "2:Lamb"
  </code></pre>
  
  <p>(happy to add classes/IDs to any divs to extract the required values)</p>
  
  <p>What should happen:</p>
  
  <ol>
  <li>On click of a save button, data is scraped into an array (via
  Jquery?)</li>
  <li>Array is sent to PHP file and inserted into the database</li>
  </ol>
  
  <p>Any help on this would be great, thanks</p>