I have the month entered by the user. ex:
$mes = 11;
Now I want to take this month and return the current (day / year / hour) + the month informed:
2015-11-08 14:44:00
I have the month entered by the user. ex:
$mes = 11;
Now I want to take this month and return the current (day / year / hour) + the month informed:
2015-11-08 14:44:00
It can be done like this.
$data = date("Y-".$mes_informado."-d H:i:s")
Try:
<?php $mes = 11; $data = substr_replace( date( 'Y--d H:i:s' ), $mes, 5, 0 );