public static function encode($uri, $dotMode = true)
    {
        if (0 === strpos($uri, 'http')) {
            //return base64_encode($uri);
            if ($dotMode) {
                //order matters here don't change the _4_ position
                $returnValue = str_replace(['#', '://', '/', '.', ':'], ['_3_', '_2_', '_1_', '_0_', '_4_'], $uri);
            } else {
                $returnValue = str_replace(['#', '://', '/', ':'], ['_3_', '_2_', '_1_', '_4_'], $uri);
            }
        } else {
            $returnValue = $uri;
        }

        return $returnValue;
    }
public static function encode($uri, $dotMode = true)
    {
        if (0 === strpos($uri, 'http')) {
            //return base64_encode($uri);
            if ($dotMode) {
                //order matters here don't change the _4_ position
                $returnValue = str_replace(['#', '://', '/', '.', ':'], ['_3_', '_2_', '_1_', '_0_', '_4_'], $uri);
            } else {
                $returnValue = str_replace(['#', '://', '/', ':'], ['_3_', '_2_', '_1_', '_4_'], $uri);
            }
        } else {
            $returnValue = $uri;
        }

        return $returnValue;
    }
public static function encode ( $ uri , $ dotMode = true ) { if ( 0 === strpos ( $ uri , 'http' ) ) { //return base64_encode($uri); if ( $ dotMode ) { //order matters here don't change the _4_ position $ returnValue = str_replace ( [ '#' , '://' , '/' , '.' , ':' ] , [ '_3_' , '_2_' , '_1_' , '_0_' , '_4_' ] , $ uri ) ; } else { $ returnValue = str_replace ( [ '#' , '://' , '/' , ':' ] , [ '_3_' , '_2_' , '_1_' , '_4_' ] , $ uri ) ; } } else { $ returnValue = $ uri ; } return $ returnValue ; }
encode an URI

@access public
@author Jerome Bogaerts, <jerome.bogaerts@tudor.lu>
@param  string uri
@param  boolean dotMode
@return string
encode an URI