从RSS描述中提取日期

I need to extract the date from a description which is displayed on an RSS Feed (Workopolis)

Here's an example of a feed item:

<item>
  <guid isPermaLink="true">http://www.workopolis.com/jobsearch/job/15161566?uc=?RSS=Y</guid>
  <link>http://www.workopolis.com/jobsearch/job/15161566?uc=?RSS=Y</link>
  <title>Financial Services Representative</title>
  <description>&lt;strong&gt;Location:&lt;/strong&gt; Barrie, Ontario; Owen Sound, Ontario; Port Elgin, Ontario&lt;br&gt;&lt;strong&gt;Job Category:&lt;/strong&gt; Sales and Business Development &lt;br&gt;&lt;strong&gt;Job Industry:&lt;/strong&gt; Financial Services and Banking&lt;br&gt;&lt;strong&gt;Career Level:&lt;/strong&gt; &lt;br&gt;&lt;strong&gt;Position Type:&lt;/strong&gt; Full Time&lt;br&gt;&lt;strong&gt;Date Posted:&lt;/strong&gt; 06/19/2014&lt;br&gt;&lt;strong&gt;Company Name:&lt;/strong&gt; CIBC&lt;br&gt;&lt;strong&gt;Company URL:&lt;/strong&gt; &lt;a href="http:// "&gt;http:// &lt;/a&gt;</description>
</item>

I've been doing research for about.. 2 hours now. I'm not strong on my more advanced PHP coding, so I could really use some help. The date is in DD/MM/YY inside of .

I guess my question is: How do I extract the date in DD/MM/YYYY and turn it into a $date variable?

Thanks!

You could use preg_match with a regex pattern tailored specifically for the date:

\d{2}\/\d{2}\/\d{4}

code:

$str = '<item>
  <guid isPermaLink="true">http://www.workopolis.com/jobsearch/job/15161566?uc=?RSS=Y</guid>
  <link>http://www.workopolis.com/jobsearch/job/15161566?uc=?RSS=Y</link>
  <title>Financial Services Representative</title>
  <description>&lt;strong&gt;Location:&lt;/strong&gt; Barrie, Ontario; Owen Sound, Ontario; Port Elgin, Ontario&lt;br&gt;&lt;strong&gt;Job Category:&lt;/strong&gt; Sales and Business Development &lt;br&gt;&lt;strong&gt;Job Industry:&lt;/strong&gt; Financial Services and Banking&lt;br&gt;&lt;strong&gt;Career Level:&lt;/strong&gt; &lt;br&gt;&lt;strong&gt;Position Type:&lt;/strong&gt; Full Time&lt;br&gt;&lt;strong&gt;Date Posted:&lt;/strong&gt; 06/19/2014&lt;br&gt;&lt;strong&gt;Company Name:&lt;/strong&gt; CIBC&lt;br&gt;&lt;strong&gt;Company URL:&lt;/strong&gt; &lt;a href="http:// "&gt;http:// &lt;/a&gt;</description>
</item>';

preg_match("/\\d{2}\/\\d{2}\/\\d{4}/u", $str, $date);

echo $date[0];

output:

06/19/2014