How would I perform this operation on a string in PHP?
So, basically, I have a bunch of data in this form:
When: Tue Feb 10, 2009 7:20am to 8am EST<br>
<br>Event Status: Status <br/>
(It’s a Google Calendar XML file).
And I want to display it with only the title and the date. The title is its own field in the XML file, so that’s fine. But the date is part of a lumped-together “summary” field, which contains the when, the who, the where, and the status. So what I want to do is add something in my PHP loop that will trim down that entire field to just the date. So in the above example, it would print like this:
Feb 10, 2009<br>
What string operations could do this? I wrestled with preg_replace to no avail.
This question is in the General Section. Responses must be helpful and on-topic.