PHP Picking things out of a form submission to populate a database
<p>I am <em>very</em> new to PHP, and need some suggestions on a good starting point for a project I am working on.</p>

<p>I have a website and a newsletter, both of which are composed of news article summaries (the website is similar to older versions of Digg, but with no user submissions). A word document is drafted in the format of:</p>

<p>Category</p>

<p>Article title</p>

<p>News article summary</p>

<p>Link to website article is found on</p>

<p>Once the word document is populated with all of the article summaries, I would like to be able to copy all of the text from the document, paste it into a single textarea field in an html form, and have PHP somehow pick out the separate story summaries and store them in a database, so they can later be pulled onto the website.</p>

<p>The only way I can think to do this is to add descriptive tags in the word document such as:</p>

<pre><code>&lt;begin_category&gt;Category&lt;end_category&gt;

&lt;begin_title&gt;Article Title&lt;end_title&gt;
</code></pre>

<p>and so on, and then have php recognize these tags (preg_match?) and pull the information from them. My questions then are, what is the best way to go about programming this? Are there any concepts I should be researching? How do I tell PHP to look for these tags and pull everything in between them? Is this a terrible way to go about this? Am I better off just having a form that has different fields for all of the items (category, title, summary, link) and submit each summary one by one?</p>

<p>The only reason I want to be able to post the entire document and have it populate is to save time. The word document must be written up regardless for the newsletter.</p>

<p>Any direction would be much appreciated; things I should be googling, articles I should be reading, etc.</p>
