Originally posted by SeenGee
..because i actually need the dates of a specific date for the next four weeks but i was told elsewhere that strtotime was not as accurate as mktime.
The problem that strtotime has is that your date is ambiguous. I presume 06/04/2004 represents 6th April, and not 4th June?
Strtotime() is less efficient than mktime(), since it has to run its argument through a whole language parser to interpret it. But if you've got an unambiguous date/time of a form that strtotime recognises (e.g., "14 January 2004"), or an interval (such as "4 weeks" or "6 days ago"), it's simpler, less hazard-prone and perhaps faster to convert it into a timestamp with strtotime() than try and effectively reconstruct a subset of strtotime()'s language with a lot of string operations and mktime().
Seeing as you need to break up the string in the first place to get the date components here, there's little point putting them all back together again in a string for the sake of strtotime(); mktime() will do the same job without the extra work.
In this case, I'd go with illeman's code, with one major difference (because four weeks isn't necessarily the same thing as 604800 seconds) and one minor difference (for efficiency). The major difference:
$datet = mktime( 0 , 0 , 0 , $datea[1] , $datea[0]+28 , $datea[2] );
And, believe it or not, mktime knows what April 38, 2004 really is.
The minor difference:
$datea = explode('/', $datev);
Because explode() is a lot less processor-intensive than split(). An alternative (which might in fact be faster) is
$datea = sscanf('%02d/%02d/%04d', $datev);
And, in future, consider using an unambiguous date format, yeah? The international standard is 'YYYY-MM-DD'.