I dint know how to title this but...
I`ll start from begining, i have a .txt file loking like this:
2011-11-14 15:39:51,Polnoc
2011-10-13 15:41:54,Polnocny-Wschod
2011-10-14 15:43:04,Wschod
Then there is a code that shows data from last mont,week,day looking like this:
$lines = file('Kier.txt');
$monthlist = "";
$weeklist = "";
$daylist = "";
foreach($lines as $line){
$r = explode(",",$line);
if(strtotime($r[0]) > strtotime('-1 month'))$monthlist .= "\n\t<li>{$r[1]}</li>";
if(strtotime($r[0]) > strtotime('-1 week'))$weeklist .= "\n\t<li>{$r[1]}</li>";
if(strtotime($r[0]) > strtotime('-1 day'))$daylist .= "\n\t<li>{$r[1]}</li>";
}
if($monthlist !="")$monthlist = "\n<ul>$monthlist\n</ul>";
if($weeklist !="")$weeklist = "\n<ul>$weeklist\n</ul>";
if($daylist !="")$daylist = "\n<ul>$daylist\n</ul>";
And a code that caunts all occurences of same data loking like this.
$getText = file_get_contents(monthlist, true);
$Poln = substr_count($getText ,"Polnoc");
$PolnW = substr_count($getText ,"Polnocny-Wschod");
$Wsch = substr_count($getText ,"Wschod");
$PoldW = substr_count($getText ,"Poludniowy-Wschod");
$Pold = substr_count($getText ,"Poludnie");
$PoldZ = substr_count($getText ,"Poludniowy-Zachod");
$Zach = substr_count($getText ,"Zachod");
$PolnZ = substr_count($getText ,"Polnocny-Zachod");
$getPoln = $Poln - $PolnW - $PolnZ ;
$getPold = $Pold;
$getZach = $Zach - $PoldZ - $PolnZ ;
$getWsch = $Wsch - $PoldW - $PolnW ;
Now everythig works fine but i need to do it a little diffrent. I need to do two text fields where i will write date from and to. And it should count occurrences only in given time. How to start with this, what should i use, is my code will be helpfull with it, and is it passible anyway??