PHP Programs

Please click on 1-2 Ads to keep this website's Study Material FREE and regularly Updated.

Program 19: Write a PHP program to a convert a string to Date and DateTime.

date.php

<!DOCTYPE html>
<html>
<head>
	<title>PHP Progarms TutorialDuniya.com</title>
</head>
<body>
	<?php
		$dt = DateTime ::createFromFormat('m-d-Y', '11-07-2019')->format('Y-m-d');
		echo $dt;
	?>
</body>
</html>



If you have any suggestion or found any error in the above program, then do let us know at [email protected] or just comment below.