RemiX adlı üyeden alıntı: mesajı görüntüle
Merhaba,
alttaki koddaki veri değişkenindeki verileri alttaki kod ile listeleyebiliyorum. Eğer tarih aralığında listeleme yapmak istesem ne yapmam gerekiyor?


$veri = "10-04-2014 @  233 @ 666 | 05-04-2014 @  -545 @ 766 | 22-03-2014 @  -656 @ 545 | 01-03-2014 @  -456 @ 15";

$veri = explode(" | ",$veri );
$dizisaysana = count($veri);
for ($i=$dizisaysana;$i>=0;$i--)
{ echo "<tr>";
    $bunudaexle = explode(" @ ",$veri [$i]);
  foreach($bunudaexle as $bune ) {
    echo "<td>$bune</td>";
  }
  echo "</tr>";
    }

Neyse kendim hallettim

$veri = explode(" | ",$veri );
$dizisaysana = count($veri);
for ($i=$dizisaysana;$i>=0;$i--)
{
    $bunudaexle = explode(" @ ",$veri [$i]);

$sondate = "20-04-2014";
$ilkdate = "03-04-2014";
$ayrac = "-";
$anadate = $bunudaexle[0];
list($g1,$a1,$y1) = explode($ayrac,$ilkdate);
list($g2,$a2,$y2) = explode($ayrac,$sondate);
list($g3,$a3,$y3) = explode($ayrac,$anadate);
$t1_timestamp = mktime('0','0','0',$a1,$g1,$y1);
$t2_timestamp = mktime('0','0','0',$a2,$g2,$y2);
$anala = mktime('0','0','0',$a3,$g3,$y3);



if (($t1_timestamp<$anala) && ($t2_timestamp>$anala)  ) {

    echo "<tr>";
    
  foreach($bunudaexle as $bune ) {
    echo "<td>$bune</td>";
  }
  echo "</tr>";
    }

}
http://stackoverflow.com/questions/6...-array-by-date
$data = array(
    array(
        "title" => "Another title",
        "date"  => "Fri, 17 Jun 2011 08:55:57 +0200"
    ),
    array(
        "title" => "My title",
        "date"  => "Mon, 16 Jun 2010 06:55:57 +0200"
    )
);

function sortFunction( $a, $b ) {
    return strtotime($a["date"]) - strtotime($b["date"]);
}
usort($data, "sortFunction");
var_dump($data);
böyle birşey buldum yardımcı olur belki