Adding dynamic content in php
Adding dynamic content means we are adding time and date to that web page.In php we are using date function for both time and date.Here is the two different syntax for the date and time to print on the web page. Date shows the present day , month and year.In that date function we can also find present time with hours , minutes,seconds .we can also know AM or PM along with that time.
Date syntax in php
date(“d-m-y”);
In this syntax d :today’s day
M:month
Y-year
Eg:-19-06-2026
Time syntax in php:
date(“h:i:s A”);
Here h:hours
i:minutes
s:seconds
A:AM or PM.
Program for dynamic content in php:
<?php
echo “good morning”.”<br>”;
echo “Today date is : ” . date(“d-m-y”).”\n”;
echo “present time is :” . date(“h:i:s A);
?>
Output:
good morning
Today date is : 19-06-2026
Present time is: 04:30:23 AM.
Explanation:
E php code lo manam echo lo good morning rasamu kabatti first line lo adhi print avuthundi.danni pakkana concatenate . Vadamu kabatti a break concatenate ayyi next line loki vastundi.a second line lo date daani tharwatha time vastundi.
Manam dynamic content in php lo date and time ni enter chesamu.date vachedi e roju date display chestadi .time hours , minutes, seconds and AM or PM tho saha ivva danaki AM or PM lowercase lo kavali ante akkada uppercase lo unna A ni lowercase lo raste a ani raste time pakkana lowercase lo vastundi..
3 thoughts on “Adding dynamic content in php”