Bkz :
token_get_all
Kullanım için php dosyasını file_get_contents ile sayfaya dahil etmeniz lazım , örnek kullanım;
$source = file_get_contents( "file.php" );
$tokens = token_get_all( $source );
$comment = array(
T_COMMENT, // All comments since PHP5
T_ML_COMMENT, // Multiline comments PHP4 only
T_DOC_COMMENT // PHPDoc comments
);
foreach( $tokens as $token ) {
if( !in_array($token[0], $comment) )
break;
// Do something with the comment
$txt = $token[1];
}Kaynak : http://stackoverflow.com/questions/3228978/php-read-file-comments-not-file-content-forgotten