All pastes #729110 Raw Edit

Stuff

public text v1 · immutable
·published 2007-10-07 17:38 UTC
rendered paste body
<?php

//Reads each file in array and displays last N lines

$files = array('README', 'list_regions.php', 'include.php', 'install.php'); //Change or add files to this array to list different files, make sure they're readable by the webserver.
$numberoflines = 10; //Change this number to change the number of lines to read from the end

foreach ($files as $file)
{

	$filecontents = file($file);

	echo '<h1>'.$file.'</h1><br />';
	echo '<pre>'."\r\n";

	for($i = $numberoflines; $i >= 0; $i--)
	{
		$lines[] = $filecontents[count($filecontents)-$i];
	}

	foreach($lines as $line)
	{
		echo htmlentities($line);
	}
	unset($lines);
	echo '<pre />'."\r\n";
	echo '<hr /><br />';
}

?>