You could implement your own Period Iterator.
Given a start date and a number of days you want to add, this will add the number of days excluding weekends
Usage
$startDateTime = new \DateTime('2017-01-27');
// Will return 5 **business days** in the future.
// Does not count the current day
// This particular example will return 02-03-2017
$endDateTime = addBusinessDays($startDateTime, 5);
The function
function addBusinessDays(\DateTime $startDateTime, $daysToAdd)
{
$endDateTime = clone $startDateTime;
$endDateTime->add(new \DateInterval('P' . $daysToAdd . 'D'));
$period = new \DatePeriod(
$startDateTime, new \DateInterval('P1D'), $endDateTime,
// Exclude the start day
\DatePeriod::EXCLUDE_START_DATE
);
$periodIterator = new PeriodIterator($period);
$adjustedEndingDate = clone $startDateTime;
while($periodIterator->valid()){
$adjustedEndingDate = $periodIterator->current();
// If we run into a weekend, extend our days
if($periodIterator->isWeekend()){
$periodIterator->extend();
}
$periodIterator->next();
}
return $adjustedEndingDate;
}
PeriodIterator Class
class PeriodIterator implements \Iterator
{
private $current;
private $period = [];
public function __construct(\DatePeriod $period) {
$this->period = $period;
$this->current = $this->period->getStartDate();
if(!$period->include_start_date){
$this->next();
}
$this->endDate = $this->period->getEndDate();
}
public function rewind() {
$this->current->subtract($this->period->getDateInterval());
}
public function current() {
return clone $this->current;
}
public function key() {
return $this->current->diff($this->period->getStartDate());
}
public function next() {
$this->current->add($this->period->getDateInterval());
}
public function valid() {
return $this->current < $this->endDate;
}
public function extend()
{
$this->endDate->add($this->period->getDateInterval());
}
public function isSaturday()
{
return $this->current->format('N') == 6;
}
public function isSunday()
{
return $this->current->format('N') == 7;
}
public function isWeekend()
{
return ($this->isSunday() || $this->isSaturday());
}
}