Ok, I wrote it for you. Let me know what you think.
<?php
// d is the begin date in the format yyyy-mm-dd
// hpd is the number of hours in a normal workday; 10 by default
// h is the number of hours needed
foreach ($_GET as $key => $value) {
$_GET[$key] = htmlentities($value);
}
$begin_date = isset($_GET['d']) ? $_GET['d'] : '2007-01-01';
$total_days = $_GET['h'] / (isset($_GET['hpd']) ? $_GET['hpd'] : 10);
$days = 0;
$temp_date = explode('-', $begin_date);
while ($days < $total_days) {
if ((date('D', mktime(0, 0, 0, $temp_date[1], $temp_date[2], $temp_date[0])) != 'Sat') && (date('D', mktime(0, 0, 0, $temp_date[1], $temp_date[2], $temp_date[0])) != 'Sun')) {
$temp_date = explode('-', $begin_date);
$begin_date = date('Y-m-d', mktime(0, 0, 0, $temp_date[1], $temp_date[2] + 1, $temp_date[0]));
$days++;
} else {
$temp_date = explode('-', $begin_date);
$begin_date = date('Y-m-d', mktime(0, 0, 0, $temp_date[1], $temp_date[2] + 1, $temp_date[0]));
}
}
echo $begin_date;
?>
http://sneamia.net/junk/Jahnoes/?d=2007-01-01&h=101 for a test.
And sorry for the triple post.