- file_get_contents: documentation ( source)
- mb_convert_encoding: documentation ( source)
<?php
//差分を見て前回から更新があったかどうか確認
$old_article = file_get_contents('');
$new_article = file_get_contents('');
$old_article = mb_convert_encoding($old_article, "SJIS", "UTF-8");
$new_article = mb_convert_encoding($new_article, "SJIS", "UTF-8");
$diff = xdiff_string_diff($old_article, $new_article, 1);
if (is_string($diff)) {
echo "2 つの差分:\n";
echo $diff;
}
?>