1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

finding a word in a page?

Discussion in 'PHP' started by Lordy, Mar 27, 2008.

  1. #1
    if i wget a page, is there any function i can use to find words located in that page? it's an html page
     
    Lordy, Mar 27, 2008 IP
  2. SimThePhpCoder

    SimThePhpCoder Well-Known Member

    Messages:
    949
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #2
    if(stristr($page, '<a href="http://www.enterstation.com"') === TRUE)
    {

    echo 'link found';
    }
    else
    {
    echo 'no link found';
    }
     
    SimThePhpCoder, Mar 27, 2008 IP
  3. buldozerceto

    buldozerceto Active Member

    Messages:
    1,137
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    88
    #3
    if you mean wget from the command line then you can use this code ( after you have downloaded the page)
    cat dowloadedpage.html | grep word
     
    buldozerceto, Mar 27, 2008 IP
  4. DavidTan

    DavidTan Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    assuming you are talking about PHP, use preg_match
     
    DavidTan, Mar 28, 2008 IP