HTMLSQL
HTMLSQLの基本的な書き方
<?php include_once("./snoopy.class.php"); include_once("./htmlsql.class.php"); $htsql = new htmlsql(); // 取得したいパターンを指定、URLはurl,ファイルならfile、文字列はstringで指定 if (!$htsql->connect('file', 'XXXX.txt')){ exit; } // SQL 文を書く if (!$htsql->query('SELECT * FROM div WHERE $class="TEST"')){ // div 要素のclassにTESTとしているものを取得する exit; } // 結果を表示する foreach($htsql->fetch_array() as $row){ echo $row['text']; } ?>
文字化け対策
htmlsql.class.php のソースの中の 201行目
$this->page = $this->snoopy->results; $this->page = mb_convert_encoding( $this->page, 'UTF-8', 'AUTO' ); // これを追加