private function getValue($value, $length)
  {
    if ($length) {
      $value = substr($value, 0, $length);
    }
    $value = rawurlencode($value);
    return $value;
  }
private function getValue($value, $length)
  {
    if ($length) {
      $value = substr($value, 0, $length);
    }
    $value = rawurlencode($value);
    return $value;
  }
private function getValue ( $ value , $ length ) { if ( $ length ) { $ value = substr ( $ value , 0 , $ length ) ; } $ value = rawurlencode ( $ value ) ; return $ value ; }
Utility function to encode and trim values
Utility function to encode and trim values