Gmail / Facebook Style Chat Application
Details Live Demo Download

Posted: Sunday 30th of September 2012

Get any Website Page Title From URL

This tutorial helps you to get the page title of any website via the website url.
The script of this tutorial takes the URL of a given page from which the page title is fetched.
To get started, just pass the url of the page that you wish to fetch its content to the getPage_Title_From_URL('url here') function and you are done.


function getPage_Title_From_URL($pageURL)
      $readPG = fopen($pageURL, 'r');
      $x = 0;
      $specifiedPG = '';

      if ($readPG)
            while (!feof($readPG) && ($x < 10))
                  $specifiedPG .= fread($readPG, 8192);
      preg_match("/<title.*?>[\n\r\s]*(.*)[\n\r\s]*<\/title>/", $specifiedPG, $pageTitleFromURL);
      if (isset($pageTitleFromURL[1]))
            if ($pageTitleFromURL[1] == '')
                  return $pageURL;
            $pageTitleFromURL = $pageTitleFromURL[1];
            return trim($pageTitleFromURL);
            return $pageURL;
//Example function call
echo getPage_Title_From_URL('');

That's it guys...



Announcement x
Dear Users and Clients,

This is to inform you that we have recently updated our website generally.

If you experience any problem viewing any part of this website or if you notice that any of our scripts or tutorials are not functioning properly as should be, please click on the Contact Link at the top of this page to report the issue to us.

Our priority is to give you the best of service!

Thank You,
The Vasplus Team