PHP is a powerful server-side scripting language for creating dynamic and interactive websites.PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.PHP is perfectly suited for Web development and can be embedded directly into the HTML code.The PHP syntax is very similar to Perl and C. PHP is often used together with Apache (web server) on various operating systems.
PHP is a powerful tool for making dynamic and interactive Web pages.
PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
In our PHP tutorial you will learn about PHP, and how to execute scripts on your server.
PHP code is executed on the server, and the plain HTML result is sent to the browser.
Basic PHP Syntax
A PHP scripting block always starts with .
A PHP scripting block can be placed anywhere in the document.
tag:-PHP Introduction, PHP Tutorial
Articles
- Articles(C#.NET) (3)
- ASP.NET (6)
- Asp.Net(Email) (1)
- Asp.net(Image) (2)
- Asp.Net(Web.Config) (2)
- C#.NET (5)
- C#.NET Threading (3)
- C#.NET(ASP.NET) (4)
- Comments in PHP (1)
- Encryption In PHP (1)
- iPhone (Articles) (1)
- JavaScript (1)
- Json with PHP (1)
- LINQ (1)
- PHP (2)
- PHP Constant (1)
- PHP Operators (1)
- PHP Print Command (1)
- PHP Tutorial (2)
- Strings In PHP (1)
- Variable Declaration In PHP (1)
- WPF (1)
- XAML (2)
About Me
Help Link
Followers
In everyday life when we deal with time, we speak in seconds, minutes, hours, days, weeks, months, years, decades, centuries, etc.... you get the idea. When PHP deals with time it uses only one measurement, seconds. More specifically it measures time in seconds since January 1, 1970. Once we know how time works in PHP, it becomes easier to add, subtract, and calculate time. Below is a quick guide:
Time in Seconds
1 Minute: 60 seconds
1 Hour: 3,600 seconds
1 Day: 86,400 seconds
1 Week: 604,800 seconds
4 Weeks: 2,419,200 seconds
1 Year: 31,536,000 seconds
1 Decade: 315,360,000 seconds
Now let's put this into practice. Let's say for example you wanted to set a cookie in a user's browser to expire in one year. The way we would calculate this is by adding one year, or 31,536,000 seconds to the current date before setting the cookie:
$Year = 31536000 + time() ;Perhaps you want to find out what calendar day occurs in a set period of time. This is what is done in pregnancy calendars. In this example we will find the calendar date that occurs in exactly 2 weeks (1209600 seconds) time. $twoweeks = 1209600 + time() ;
echo date("M-d-Y", $twoweeks) ;
