Ejemplo n.º 1
0
 /**
  * Decodes the given URL encoded string
  * @see  http://php.net/manual/en/function.curl-unescape.php Official PHP documentation for curl_unescape()
  * @param  string $str The URL encoded string to be decoded
  * @return string Returned decoded string or **FALSE** on failiure
  */
 public function unescape($str)
 {
     return curl_unescape($this->_ch, $str);
 }
<?php

$str = "http://www.php.net/ ?!";
$a = curl_init();
$escaped = curl_escape($a, $str);
$original = curl_unescape($a, $escaped);
var_dump($escaped, $original);
var_dump(curl_unescape($a, 'a%00b'));
Ejemplo n.º 3
0
 /**
  * @param string $string
  * @return bool|string
  */
 public function unescape($string)
 {
     return curl_unescape($this->handle, $string);
 }
Ejemplo n.º 4
0
 /**
  * Decode a url-encoded string like you would get from http_build_query()
  *
  * @param $string
  * @return bool|string
  */
 public function decode($string)
 {
     return curl_unescape($this->ch, $string);
 }
Ejemplo n.º 5
0
 public function unescape(string $str) : string
 {
     if (!is_resource($this->init)) {
         throw new InvalidArgumentException('Error', 'resourceParameter', '1.(ch)');
     }
     return curl_unescape($this->init, $str);
 }
Ejemplo n.º 6
0
 public function unescape($str = '')
 {
     if (!isPhpVersion('5.5.0')) {
         die(getErrorMessage('Error', 'invalidVersion', array('%' => 'curl_unescape', '#' => '5.5.0')));
     }
     if (!is_resource($this->init)) {
         return Error::set('Error', 'resourceParameter', '1.(ch)');
     }
     return curl_unescape($this->init, $str);
 }
Ejemplo n.º 7
0
 /**
  * @param string $str
  *
  * @return bool|string
  */
 public function unescape($str)
 {
     return function_exists('curl_unescape') ? curl_unescape($this->_curl_handle, $str) : $str;
 }
Ejemplo n.º 8
0
 /**
  * Decodes the given URL encoded string
  *
  * @param string $str The URL encoded string to be decoded.
  * @return string     The decoded string
  */
 public final function curlUnescape($str)
 {
     return curl_unescape($this->curl_handle, $str);
 }