original_string: protected static function encode_url($url)
      {
          $reserved = array(
              ':' => '!%3A!ui',
              '/' => '!%2F!ui',
              '?' => '!%3F!ui',
              '#' => '!%23!ui',
              '[' => '!%5B!ui',
              ']' => '!%5D!ui',
              '@' => '!%40!ui',
              '!' => '!%21!ui',
              '$' => '!%24!ui',
              '&' => '!%26!ui',
              "'" => '!%27!ui',
              '(' => '!%28!ui',
              ')' => '!%29!ui',
              '*' => '!%2A!ui',
              '+' => '!%2B!ui',
              ',' => '!%2C!ui',
              ';' => '!%3B!ui',
              '=' => '!%3D!ui',
              '%' => '!%25!ui'
          );
          $url = preg_replace(array_values($reserved), array_keys($reserved), rawurlencode($url));
          return $url;
      }
code: protected static function encode_url($url)
      {
          $reserved = array(
              ':' => '!%3A!ui',
              '/' => '!%2F!ui',
              '?' => '!%3F!ui',
              '#' => '!%23!ui',
              '[' => '!%5B!ui',
              ']' => '!%5D!ui',
              '@' => '!%40!ui',
              '!' => '!%21!ui',
              '$' => '!%24!ui',
              '&' => '!%26!ui',
              "'" => '!%27!ui',
              '(' => '!%28!ui',
              ')' => '!%29!ui',
              '*' => '!%2A!ui',
              '+' => '!%2B!ui',
              ',' => '!%2C!ui',
              ';' => '!%3B!ui',
              '=' => '!%3D!ui',
              '%' => '!%25!ui'
          );
          $url = preg_replace(array_values($reserved), array_keys($reserved), rawurlencode($url));
          return $url;
      }
code_tokens: protected static function encode_url ( $ url ) { $ reserved = array ( ':' => '!%3A!ui' , '/' => '!%2F!ui' , '?' => '!%3F!ui' , '#' => '!%23!ui' , '[' => '!%5B!ui' , ']' => '!%5D!ui' , '@' => '!%40!ui' , '!' => '!%21!ui' , '$' => '!%24!ui' , '&' => '!%26!ui' , "'" => '!%27!ui' , '(' => '!%28!ui' , ')' => '!%29!ui' , '*' => '!%2A!ui' , '+' => '!%2B!ui' , ',' => '!%2C!ui' , ';' => '!%3B!ui' , '=' => '!%3D!ui' , '%' => '!%25!ui' ) ; $ url = preg_replace ( array_values ( $ reserved ) , array_keys ( $ reserved ) , rawurlencode ( $ url ) ) ; return $ url ; }
docstring: URL encoder according to RFC 3986
  Returns a string containing the encoded URL with disallowed characters converted to their percentage encodings.
  
  @link http://publicmind.in/blog/url-encoding/
  
  @param  string $url
  @return string string
docstring_tokens: URL encoder according to RFC 3986 Returns a string containing the encoded URL with disallowed characters converted to their percentage encodings .