Created
March 19, 2012 01:36
-
-
Save mgng/2089540 to your computer and use it in GitHub Desktop.
PHP互換性調査。changelogから Upgraded、Updated、Added、Change、Removed、Allowed あたりを抜き取る。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$log = file( 'http://php.net/ChangeLog-5.php' ) or die( 'error' ); | |
$buf = array(); | |
foreach ( $log as $line ) { | |
$tmp = trim( $line ); | |
if ( preg_match( '/^<h3>Version\s+\d.+?<\/h3>/i', $tmp ) ) { | |
$buf[] = "\n--------" . trim( strip_tags( $line ) ); | |
} | |
if ( preg_match( '/^<li>(Upgraded|Updated|Added|Change|Removed|Allowed).+/i', $tmp ) === 1 ) { | |
$buf[] = trim( strip_tags( $line ) ); | |
} | |
} | |
echo "via: http://php.net/ChangeLog-5.php\n\n", implode( "\n", $buf ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment