You return a value before your unset-statement:
function files()
{
$list = array();
$list = file($file) or die('read error');
print_r($list); //debug
return $s = ($list[0]);
// Every statement after this line wouldn't be called, because you
// already returned
unset($list[0]);
}
Try
$result = $list[0];
// And at the end of your function
return $result;