public function dir_from_url($url){
    $dir = false;
    foreach ( $this->dirs() as $i => $d ){
      if ( (strpos($url, $i) === 0) &&
        (\strlen($i) > \strlen($dir) )
      ){
        $dir = $i;
        break;
      }
    }
    return $dir;
  }
public function dir_from_url($url){
    $dir = false;
    foreach ( $this->dirs() as $i => $d ){
      if ( (strpos($url, $i) === 0) &&
        (\strlen($i) > \strlen($dir) )
      ){
        $dir = $i;
        break;
      }
    }
    return $dir;
  }
public function dir_from_url ( $ url ) { $ dir = false ; foreach ( $ this -> dirs ( ) as $ i => $ d ) { if ( ( strpos ( $ url , $ i ) === 0 ) && ( \ strlen ( $ i ) > \ strlen ( $ dir ) ) ) { $ dir = $ i ; break ; } } return $ dir ; }
Returns the dir's name from an URL

@param string $url
@return bool|int|string
Returns the dir s name from an URL