<?php
$fn = fopen("/root/code/php/test.txt","r");
$retbuf = "";
#按行读取
while(!feof($fn))
{
$result = fgets($fn);
# 去除换行符
$result = str_replace(PHP_EOL, '', $result);
$arrLine = explode(":", $result);
if (count($arrLine) == 2)
{
$retbuf .= $arrLine[1];
}
}
echo $retbuf;
fclose($fn);