PHP recursive directory remove function

I came across developing this function for the project that I'm working on, so I thought it might be useful piece of code to share. It's simple and based on php 5.2.

function RemoveDir($sDir) {
  if (is_dir($sDir)) {
    $sDir = rtrim($sDir, '/');
    $oDir = dir($sDir);
    while (($sFile = $oDir->read()) !== false) {
      if ($sFile != '.' && $sFile != '..') {
        (!is_link("$sDir/$sFile") && is_dir("$sDir/$sFile")) ? RemoveDir("$sDir/$sFile") : unlink("$sDir/$sFile");
      }
    }
    $oDir->close();
    rmdir($sDir);
    return true;
  }
  return false;
}

More from Recursive + PHP + Directory