Jump to content

Print till a flagged character is found


weaksauce1

Recommended Posts

I have a variable, $desc, that I am getting from an RSS feed. The data that I get out of the variable changes slightly from entry to entry of the feed. The feed comes from Google calendar and it basically displays the date then junk that I don't need. I would just do a echo substr($desc, 0,x) but when it can also just be a single date if the event doesn't span for more than 1 day, and when its a single digit day of the month, its is interpreted as a single digit throwing off the substring numbers every time.

 

I am using magpie for my parser, and an example of the rss code that I get from google can be here :

<title type='html'>Regional Conferences</title>
<summary type='html'>
When: Fri Aug 15, 2008 to Sun Aug 17, 2008&nbsp;
<br>
<br>Where: Our House
<br>Event Status: confirmed
</summary>

 

So basically I just want to print the title and the the first line of the summary. Something like :

Regional Conferences
When: Fri Aug 15, 2008 to Sun Aug 17, 2008

 

Thats all I want to display, not the other stuff like Where etc. I was wondering if you could somehow just print that first line of rss code? Any help will be appreciated, thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/117334-print-till-a-flagged-character-is-found/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.