Return to Snippet

Revision: 32750
at November 6, 2012 08:46 by jprochazka


Updated Code
<?php
function getTitle(){
  $fp = fopen("http://www.example.com","r");
  while (!feof($fp) ){
    $page .= fgets($fp, 4096);
  }
  $title = eregi("<title>(.*)</title>",$page,$regs);
  return $regs[1];
  fclose($fp);
}
?>

Revision: 32749
at October 2, 2010 01:36 by jprochazka


Updated Code
<?php

function get_title_value(){
  $fp = fopen("http://www.example.com","r");
  while (!feof($fp) ){
    $page .= fgets($fp, 4096);
  }
  $title = eregi("<title>(.*)</title>",$page,$regs);
  echo $regs[1];
  fclose($fp);
}

?>

Revision: 32748
at October 2, 2010 01:36 by jprochazka


Initial Code
<?php

function get_title_value(){
  $fp = fopen("http://www.example.com","r");
  while (!feof($fp) ){
    $page .= fgets($fp, 4096);
  }
  $title = eregi("<title>(.*)</title>",$page,$regs);
  echo $regs[1];
  fclose($fp);
}

?>

Initial URL

                                

Initial Description
Finds an "SEO Friendly" title placed in the URL after the domain and returns the value.

Initial Title
Find the \"SEO Friendly\" title in a URL.

Initial Tags

                                

Initial Language
PHP