自分用メモ
$html = ブログから抜き出したソース;
preg_match("/抜き出すパターン/", $html);
最初は正規表現が間違っているのかと思い、いくつか正規表現のパターンを変えてテストしてみましたが、手ごたえなし(´;ω;`)ウッ…
正規表現以外の問題だと思い、さらに基本的なことを調べてみると・・・
「検索対象の文字列が1行か、複数行か。」
ここが問題だったようです…
.htaccessに以下を記述してルートに設置
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
RewriteBase /
# Rewrite URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
参考:http://eru-net.jp/web/?itemid=58
graffiti on the web
この投稿へのコメント
コメントはまだありません。