php Webページのタイトルの取得


   
   
   
   
  1. $url = 'http://www.hao123.com';  
  2. $lines_array = file($url);  
  3. echo $lines_array
  4. echo "
    "
  5. $lines_string = implode(''$lines_array);   
  6. eregi("(.*)"$lines_string$head); 
  7. echo "head:".$head;  
  8. echo "
    "
  9. print_r($head); 
  10. echo "
    "
    ;  
  11. echo "title:".$head[1]; 
  12. ?>