"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Õ¾µã¶¼Õý³££¬¿ÉÖ»ÓÐ×î½ü½¨µÄÕâ¸öÕ¾µã£¬Ö»ÒªÒ»ä¯ÀÀphpÎļþ¾Í³öÏÖÏÂÔØÌáʾ£¬ÏÂÔØÏÂÀ´µÄÎļþ¶¼ÊÇ´øÓÐphpÔ´Â룬¸÷λ·¹ýµÄ£¬°ï°ïÎÒ£¬¿´¿´Ê²Ã´ÔÒò£¬ÏÈлÁË¡£
¿ÉÄÜÊÇÒòΪ¸ÃÕ¾µãûÓÐÄãÏëÒªµÄä¯ÀÀÆ ......
ÎÒÔÚÍøÕ¾µÄÒýµ¼Ò³ÖÐÌí¼ÓÁË<embed src="ÒôÀÖµØÖ·" autostart="true" loop="true" hidden="true"></embed>
Õâ¾ä»°£¬È»ºóÌø×ªÒ³Ãæºó£¬±³¾°ÒôÀÖ¾ÍûÓÐÁË£¬ÔõôÈÃÕ ......
×î½üÒ»¸öÏîÄ¿ÖÐÓöµ½Ò»¸öÎÊÌ⣺ÔÚÔÓеÄÒ»Ì×ϵͳÖÐ(php¿ª·¢)Ìí¼ÓһЩС¹¦ÄÜ(jsp¿ª·¢)£¬ÔÀ´Óû§ÏµÍ³¶¼ÊÇphp¿ª·¢µÄ£¬ÎÒÈçºÎÔÚjsp¿ª·¢µÄ¹¦ÄÜÖÐ×öµ½Óû§ÐÅÏ¢sessionͬ²½ÄØ£¿ ÓÐÈËÊÇ·ñÓÐ×ö¹ýÀàÒÔÏîÄ¿£¬ÏëÌýÌý´ó¼ÒµÄ¿´·¨
......