Posted By

jprochazka on 10/02/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

navi4all


Find the "SEO Friendly" title in a URL.


 / Published in: PHP
 

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

  1. <?php
  2. function getTitle(){
  3. $fp = fopen("http://www.example.com","r");
  4. while (!feof($fp) ){
  5. $page .= fgets($fp, 4096);
  6. }
  7. $title = eregi("<title>(.*)</title>",$page,$regs);
  8. return $regs[1];
  9. fclose($fp);
  10. }
  11. ?>

Report this snippet  

You need to login to post a comment.