Click to See Complete Forum and Search --> : opening files with php


dan.coop3r
10-30-2007, 11:42 AM
Hi,

I have an problem that I can seem to work out.

I understand how to open and read files. And to play with the arrays, but I have come across a weird situation.

Basically I am opening server log files and playing with the data in php, but the files are created daily by the server and named 'exddmmyy.log' dd=day mm=month yy=year. How can I get the php to open the correct file each day??

callumd
10-30-2007, 11:55 AM
$filename = 'ex' . date('dmy') . '.log';


Today (in my timezone), this script will give $filename a value of ex311007.log