"ID","NAME","AGE"
"1","polo","18"
"2","tony","20"
"3","jack","19"    input.txt
Ïòinput.txtÖÐÌí¼ÓÒ»ÁÐCONTENTֵΪ1,2,3ÈçºÎʵÏÖ
PHP code: 
<?php
$sContent = file_get_contents("input.txt");
$iFirst = stripos($sContent, "\n");
$sFirst = substr($sContent, 0, $iFirst-1) . ',"CONTENT"' . "\n";
$iSecode = stripos($sContent, "\n", $iFirst+strlen('\n'));
$sSecode = substr($sContent, $iFirst+strlen('\n')-1, $iSecode-$iFirst-strlen('\n')) . ',"1"'. "\n";
$iThird = stripos($sContent, "\n", $iSecode+strlen('\n'));
$sThird = substr($sContent, $iSecode+strlen('\n')-1, $iThird-$iSecode-strlen('\n')) . ',"2"'. "\n";
$sFour = substr($sContent, $iThird+strlen('\n')-1, -1) .',"3"'. "\n";
echo $sFirst . $sSecode . $sThird . $sFour;
file_put_contents("input.txt", $sFirst . $sSecode . $sThird . $sFour);
?>
¿É³ÖÐøÍùÿÐкó×·¼Ó£¬´Ë¶Î¿ÉÓÃÑ»·¸Äд
$s = <<< TEXT
"ID","NAME","AGE"
"1","polo","18"
"2","tony","20"
"3","jack","19"
TEXT;
    
 
	
    ×î½üÒ»¸öÏîÄ¿ÖÐÓöµ½Ò»¸öÎÊÌ⣺ÔÚÔÓеÄÒ»Ì×ϵͳÖÐ(php¿ª·¢)Ìí¼ÓһЩС¹¦ÄÜ(jsp¿ª·¢)£¬ÔÀ´Óû§ÏµÍ³¶¼ÊÇphp¿ª·¢µÄ£¬ÎÒÈçºÎÔÚjsp¿ª·¢µÄ¹¦ÄÜÖÐ×öµ½Óû§ÐÅÏ¢sessionͬ²½ÄØ£¿ ÓÐÈËÊÇ·ñÓÐ×ö¹ýÀàÒÔÏîÄ¿£¬ÏëÌýÌý´ó¼ÒµÄ¿´·¨
 ......