Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6022077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:48:25+00:00 2026-05-23T03:48:25+00:00

i have a page like this <html> <head> <title>mytitle</title> </head> <body> my data some

  • 0

i have a page like this

<html>
<head>
<title>mytitle</title>
</head>
<body>
 my data 
 some pics...
</body>
 data and some pics 
</html>

i need a facebook share like script ,, so when any one type a website url , this script get website title ,, images as thumbnails and some data from body tag .. any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:48:26+00:00Added an answer on May 23, 2026 at 3:48 am
    function getMetaTitle($content){
        $pattern = "|<[\s]*title[\s]*>([^<]+)<[\s]*/[\s]*title[\s]*>|Ui";
        if(preg_match($pattern, $content, $match))
        return $match[1];
        else
        return false;
    }
    function getMetaDescription($content) {
        $metaDescription = false;
        $metaDescriptionPatterns = array("/]*>/Ui", "/]*>/Ui");
        foreach ($metaDescriptionPatterns as $pattern) {
        if (preg_match($pattern, $content, $match))
        $metaDescription = $match[1];
        break;
        }
        return $metaDescription;
    } 
    
    
       function getExcerpt($content) {
        $text = html_entity_decode($content);
        $excerpt = array();
        //match all tags
        preg_match_all("|<[^>]+>(.*)]+>|", $text, $p, PREG_PATTERN_ORDER);
        for ($x = 0; $x < sizeof($p[0]); $x++) {
        if (preg_match('< p >i', $p[0][$x])) {
            $strip = strip_tags($p[0][$x]);
            if (preg_match("/\./", $strip))
            $excerpt[] = $strip;
        }
        if (isset($excerpt[0])){
            preg_match("/([^.]+.)/", $strip,$matches);
            return $matches[1];
            }
        }
        return false;
     }
    
    url = 'http://www.example.com/';
    $content = file_get_contents($url);
    $title = getMetaTitle($content);
    $description = getMetaDescription($content);
    $excerpt = getExcerpt($content);
    print "title: $title ";
    print "< br />";
    print "description: $description ";
    print "< br />";
    print "excerpt: $excerpt";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that look like this. <html> <head> <title>Welcome</title> </head> <body bgcolor=white
a) I have an html page that looks like this: <html> <head> <title>Page Title</title>
I have an HTML doc that looks roughly like this: <html> <head><title>Example</title></head> <body> <div
I have a html page like this <html xmlns=http://www.w3.org/1999/xhtml> <head> <script src=JScript2.js type=text/javascript></script> <script
I have a page like this: <html> <head> <script language=javascript type=text/javascript src=jquery-1.4.2.min.js></script> <script language=javascript
I have this script on my html page: <script language='javascript'>parent.resizeTo(550,510);</script> I'd like to add
I have main page that looks like this: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html
I have the following code: <html> <head> <title><?php echo $GLOBALS['L']['title']; ?></title> </head> <body> <ul
I have a page defined as: <%@ Page Language=C# %> <html> <head> <title>Untitled 1</title>
i have script like this.... <head> <meta http-equiv=content-type content=text/html; charset=iso-8859-1 /> <meta name=author content=bbbbb

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.