Belirli Bir Günden Önceki ve Sonraki Tarihleri Bulma

<?php
class tarihbul{
public $tarih1, $yenitarih, $veri;
	function __construct($tarih, $gun, $islem){
		$this->tarih1 = $tarih;
		switch ($islem){
			case "+":
				$this->veri = strtotime($tarih) + $gun * 86400;
				break;
			case "-":
				$this->veri = strtotime($tarih) - $gun * 86400;
				break;
		}
		$this->yenitarih = date("d.m.Y",$this->veri);
	}
}
// Yarinı Bul
$sonuc = new tarihbul(date("d.m.Y"), "1", "+");
echo $sonuc->yenitarih."<br>";
// Dünü Bul
$sonuc = new tarihbul(date("d.m.Y"), "1", "-");
echo $sonuc->yenitarih."<br>";
// 13.05.2015'ten 50 gün sonrasını bul 
$sonuc = new tarihbul(("13.05.2015"), "50", "+");
echo $sonuc->yenitarih."<br>";
?>

Çıktısı

14.05.2018
12.05.2018
02.07.2015

 

Sizin Değerli Görüşlerinize İhtiyacımız Var.