- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$current_month_first='01'.'-'.date("m").'-'.date("Y");
$current_month_first_stamp=strtotime($current_month_first);
$kezdonapszam="5";
$kezdonapszam_int= (int) $kezdonapszam;
$kezdonapszam_int=$kezdonapszam_int-1;
$kezdo_full=add_date($current_month_first, $kezdonapszam_int);
//if (strtotime($kezdo_full)<$current_month_first_stamp)
// {$kezdo_full=add_date($kezdo_full,0,1);}
print date("Y-m-d",$kezdo_full);