stripslashes() статический публичный Метод

A better way to strip slashes
static public stripslashes ( string $string ) : string
$string string
Результат string
Пример #1
0
 /**
  * Sanitizes the incoming data
  * 
  * @param  array $data
  * @return array
  */
 static function sanitize($data)
 {
     foreach ($data as $key => $value) {
         if (!is_array($value)) {
             $value = trim(str::stripslashes($value));
         } else {
             $value = self::sanitize($value);
         }
         $data[$key] = $value;
     }
     return $data;
 }
Пример #2
0
 function get($key = false, $default = null)
 {
     if (empty($key)) {
         return $_REQUEST;
     }
     $value = a::get($_REQUEST, $key, $default);
     return !is_array($value) ? trim(str::stripslashes($value)) : $value;
 }
Пример #3
0
 /**
  * Private method to sanitize incoming request data
  *
  * @param array $data
  * @return array
  */
 protected static function sanitize($data)
 {
     if (!is_array($data)) {
         return trim(str::stripslashes($data));
     }
     foreach ($data as $key => $value) {
         $data[$key] = static::sanitize($value);
     }
     return $data;
 }
Пример #4
0
 function get($key = false, $default = null)
 {
     $request = self::method() == 'GET' ? $_REQUEST : array_merge($_REQUEST, self::body());
     if (empty($key)) {
         return $request;
     }
     $value = a::get($request, $key, $default);
     return !is_array($value) ? trim(str::stripslashes($value)) : $value;
 }