I want to replace the month number of a string of date in mm-dd-yy format.
<?php
$db_currentDate = '2015-01-26';
$month = '03';
echo substr_replace($db_currentDate,$month, 5,6);
?>
But this output only 2015-03 , I want this output to be 2015-03-26. Can anyone help me with this? Thanks
string: "03" (length=2)