regular exp

Discussion in 'Programming' started by roice, Oct 5, 2010.

  1. #1
    Hello,
    I find website that publish music news. I wish to use PHP - file get content in order to get the first 4 news in it.
    I know that it goes like this:
    The url to the full article and the title are here:
    <a class="item-head" href="http://www.mouse.co.il/CM.articles_item,694,209,47949,.aspx">ARTICL TITLE</a>
    PHP:
    Article summery goes here:
    <div class="item-text">ARTICLE SUMMERY</div>
    PHP:
    Article image is here:
    <div class="item-right">
    	<a href="http://www.mouse.co.il/CM.articles_item,694,209,47949,.aspx">
    	    <img src="http://images.mouse.co.il/storage/b/d/IMAGE-NAME.jpg" height="87" width="132" /></a>
    </div>
    PHP:
    How can I get into 4 variables those contents?

    Thank you in advance!
     
    roice, Oct 5, 2010 IP
  2. jocurileus

    jocurileus Peon

    Messages:
    53
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't know how well you know php, but you could use
    http://simplehtmldom.sourceforge.net/
    Code (markup):
    this class makes it easy to grab other webpages and find specific elements.

    Just take a look at the example and you will figure it out!
     
    jocurileus, Oct 5, 2010 IP
  3. roice

    roice Peon

    Messages:
    200
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks!
    .............
     
    roice, Oct 7, 2010 IP