标签:php
<?php $fp = fopen("test.txt", "r"); $firstLines = fgets($fp); fclose($fp); $vars = explode(‘ ‘, $firstLines,2); if(DIRECTORY_SEPARATOR == ‘/‘){ file_put_contents(‘test.log‘, $vars[0].‘ ‘.date(‘Y-m-d H:i:s‘,time())."\r\n",FILE_APPEND); else{ file_put_contents(‘test.log‘, $vars[0].‘ ‘.date(‘Y-m-d H:i:s‘,time())."\n",FILE_APPEND); }
标签:php
原文地址:http://quietnight.blog.51cto.com/7163892/1678574