public static function getByName(String $get, $index = NULL) : String
    {
        $segArr = self::segmentArray();
        
        $getVal = (int) array_search($get, $segArr);

        if( $index === 'all' )
        {
            $indexVal = count($segArr) - 1;
        }
        else
        {
            $indexVal = array_search($index, $segArr);
        }

        $return = '';

        for( $i = $getVal; $i <= $indexVal; $i++ )
        {
            $return .= $segArr[$i]."/";
        }

        return substr($return, 0, -1);
    }
public static function getByName(String $get, $index = NULL) : String
    {
        $segArr = self::segmentArray();
        
        $getVal = (int) array_search($get, $segArr);

        if( $index === 'all' )
        {
            $indexVal = count($segArr) - 1;
        }
        else
        {
            $indexVal = array_search($index, $segArr);
        }

        $return = '';

        for( $i = $getVal; $i <= $indexVal; $i++ )
        {
            $return .= $segArr[$i]."/";
        }

        return substr($return, 0, -1);
    }
public static function getByName ( String $ get , $ index = NULL ) : String { $ segArr = self :: segmentArray ( ) ; $ getVal = ( int ) array_search ( $ get , $ segArr ) ; if ( $ index === 'all' ) { $ indexVal = count ( $ segArr ) - 1 ; } else { $ indexVal = array_search ( $ index , $ segArr ) ; } $ return = '' ; for ( $ i = $ getVal ; $ i <= $ indexVal ; $ i ++ ) { $ return .= $ segArr [ $ i ] . "/" ; } return substr ( $ return , 0 , - 1 ) ; }
Used to get the range according to the specified segment names.

@param string $get
@param mixed  $index = NULL

@return string
Used to get the range according to the specified segment names .