code: protected function getFileName($path)
      {
          $url = parse_url($path);
          if ($url['host']) {
              $fileName = isset($url['path']) ? $url['path'] : $url['host'];
              if (strpos($fileName, '/') === 0) {
                  $fileName = substr($fileName, 1);
              }
              return $fileName;
          }
  
          return '';
      }
docs: Extract file name
  
  @param string $path
  @return string