Fetching external page's specific content into an array

Discussion in 'PHP' started by thinkdj, Jan 8, 2008.

  1. #1
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Dancing Baby&nbsp;-&nbsp;</title>
    <meta name="description" content="Picture of Baby Dancing.." />
    <meta name="keywords" content="image gallery,cute,baby " />
    <meta name="Generator" content="Joomla! - Copyright (C) 2005 - 2006 Open Source Matters. All rights reserved. JoomSEF SEO by Artio (http://www.artio.net) - databases, information system and web applications" />
    <meta name="robots" content="index, follow" />
    <script type="text/javascript" src=".....




    I need to fetch the external URL and extract meta tags' contents into an array .. How do i do that ??

    I know this can be done by file_get_contents, followed by a preg_match... But have no clue towards the regex used.. Please help..

    Also, could anyone pleasee suggest a good tut. for learnig the basics of regular expressions and preg_match..

    Thanks in advance..
     
    thinkdj, Jan 8, 2008 IP
  2. sunnyverma1984

    sunnyverma1984 Well-Known Member

    Messages:
    342
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    120
    #2
    sunnyverma1984, Jan 8, 2008 IP
  3. thinkdj

    thinkdj Peon

    Messages:
    114
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks a lot for enlightening me with the info. I didn't even know such a function existed for fetching META tags.. It works great.. Thanks again
     
    thinkdj, Jan 8, 2008 IP