views:

46

answers:

1
<div class="plugin-block"> 
<h3><a href="http://wordpress.org/extend/plugins/sailthru-triggermail/"&gt;Sailthru&lt;/a&gt;&lt;/h3&gt; 
**Intergrate Sailthru API functionality into your WordPress blog.** 
<ul class="plugin-meta"> 
    <li><span class="info-marker">Version</span> 1.0</li> 
    <li><span class="info-marker">Updated</span> 2010-9-7</li> 
    <li></li> 
    <li> 
        <span class="info-marker left">Average Rating</span> 
        <div class="star-holder"> 
            <div class="star star-rating" style="width: 0px"></div> 
            <div class="star star5"><img src="http://wordpress.org/extend/plugins-plugins/bb-ratings/star.gif" alt="5 stars" /></div> 
            <div class="star star4"><img src="http://wordpress.org/extend/plugins-plugins/bb-ratings/star.gif" alt="4 stars" /></div> 
            <div class="star star3"><img src="http://wordpress.org/extend/plugins-plugins/bb-ratings/star.gif" alt="3 stars" /></div> 
            <div class="star star2"><img src="http://wordpress.org/extend/plugins-plugins/bb-ratings/star.gif" alt="2 stars" /></div> 
            <div class="star star1"><img src="http://wordpress.org/extend/plugins-plugins/bb-ratings/star.gif" alt="1 star" /></div> 
        </div> 
    </li> 
</ul> 
<br class="clear" /> 

I need to save the text Integrate Sailthru API functionality into your Wordpress blog.

Anyone know how to do this?

A: 

It really depends on how much this format might change over time and what you want to rely on as constant. If you want to assume that your html will always start with <div class="plugin-block"> and the text you want will always be on a line after an h3, you can do something like this:

$pattern = '/plugin-block(?:\n|.)*?<\/h3>\s*(.+)/';
preg_match($pattern, $html, $matches);

echo $matches[1]; //**Intergrate Sailthru API functionality into your WordPress blog.**
takteek