Send to a Friend
How would I perform this operation on a string in PHP?
So, basically, I have a bunch of data in this form:
<li>
<h2>Title</h2>
When: Tue Feb 10, 2009 7:20am to 8am EST<br>
<br>Who: Author
<br>Where: Place
<br>Event Status: Status <br/>
</li>
(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:
<li>
<h2>Title</h2>
Feb 10, 2009<br>
</li>
What string operations could do this? I wrestled with preg_replace to no avail.
Using Fluther
or