<?php
// Kayıt tarihi (örneğin, veritabanından alınan tarih)
$register_date = "2023-03-10";
// Geçen süre hesaplanıyor
$current_date = date("Y-m-d"); // Şu anki tarih
$date_diff = strtotime($current_date) - strtotime($register_date);
$days_diff = round($date_diff / (60 * 60 * 24)); // gün cinsinden fark
// Geçen süre için if koşulları
if ($days_diff == 0) {
echo "Bugün kayıt oldunuz.";
} elseif ($days_diff == 1) {
echo "Dün kayıt oldunuz.";
} elseif ($days_diff < 7) {
echo $days_diff . " gün önce kayıt oldunuz.";
} elseif ($days_diff < 14) {
echo "1 hafta önce kayıt oldunuz.";
} elseif ($days_diff < 21) {
echo "2 hafta önce kayıt oldunuz.";
} else {
echo "3 haftadan daha önce kayıt oldunuz.";
}
?>