コード例 #1
0
ファイル: File.php プロジェクト: bhirsch/voipdev
 /**
  * Given a file name, determine if the file contents make it an html file
  *
  * @param string $name name of file
  *
  * @return boolean     true if file is html
  * @access public
  */
 static function isHtml($name)
 {
     $fd = fopen($name, "r");
     if (!$fd) {
         return false;
     }
     $html = false;
     $lineCount = 0;
     while (!feof($fd) & $lineCount <= 5) {
         $lineCount++;
         $line = fgets($fd, 8192);
         if (!CRM_Utils_String::isHtml($line)) {
             $html = true;
             break;
         }
     }
     fclose($fd);
     return $html;
 }