Hi i have a code that shows me some repitnig data from .txt file. Code looks like:
$getText = file_get_contents("Kier.txt", 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 ;
echo "Polnoc =". $getPoln;
echo "<br>";
echo "Polnocny-wschod =". $PolnW;
echo "<br>";
echo "Wschod =". $getWsch ;
echo "<br>";
echo "Poludniwy-Wschod =". $PoldW ;
echo "<br>";
echo "Poludnie =". $getPold ;
echo "<br>";
echo "Poludniwy-Zachod =". $PoldZ ;
echo "<br>";
echo "Zachod =". $getZach ;
echo "<br>";
echo "Polnocny-Zachod =". $PolnZ ;
and data in text file looks like:
2011-11-14 15:39:51,Polnoc
2011-10-13 15:41:54,Polnocny-Wschod
2011-10-30 15:43:04,Wschod
And now its shows me all the occurences in txt file. I want to show do that it would show me only data form last monht,week,day but dont know how to start, do any of you have some good simple idea??