只有一行代码的计数器
echo sprintf(($a=@file_get_contents('./counter.txt')+1), file_put_contents('./counter.txt', $a));
echo preg_replace('#(\d+)#e', "$1+!file_put_contents('/tmp/counter.txt','$1')", @file_get_contents('/tmp/counter.txt')+1)
事实证明,结尾可以不要分号
($a=@file_get_contents('/tmp/counter.txt')+1) | file_put_contents('/tmp/counter.txt',$a) | print($a);

浙公网安备 33010602011771号