Solved

PHP MySQL mktime weekly data

Posted on 2011-02-25
1
413 Views
Last Modified: 2012-05-11
I have a visitors log table with the time in the mktime format. I want to generate the weekly report based on this data. How can I do weekly increment of the mktime from min mktime to the max mktime. I need to count the weekly hits from this.
0
Comment
Question by:PranjalShah
1 Comment
 
LVL 3

Accepted Solution

by:
Zakabog earned 500 total points
ID: 34985258
<?php

$minTime = mktime(); // Your starting mktime
$maxTime = strtotime("+1 week", $minTime); // One week after your starting mktime

echo date("Y-m-d", $minTime) . " - " . date("Y-m-d", $maxTime); // Print out your $minTime and $maxTime to show you it's working

?>
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question