Logo Search packages:      
Sourcecode: yate version File versions  Download package

Yate::Escape ( str,
extra = "" 
)

Static function to convert a string to its Yate escaped format

Parameters:
$str String to escape
$extra (optional) Character to escape in addition to required ones
Returns:
Yate escaped string

Definition at line 110 of file libyate.php.

Referenced by Acknowledge(), Dispatch(), Install(), and Uninstall().

    {
      $str = $str . "";
      $s = "";
      $n = strlen($str);
      for ($i=0; $i<$n; $i++) {
          $c = $str{$i};
          if ((ord($c) < 32) || ($c == $extra)) {
            $c = chr(ord($c) + 64);
            $s .= '%';
          }
          else if ($c == '%')
            $s .= $c;
          $s .= $c;
      }
      return $s;
    }


Generated by  Doxygen 1.6.0   Back to index