PHP FILTER_SANITIZE_ENCODED 过滤器

PHP 教程 · 2019-01-25 20:11:55

定义和用法

FILTER_SANITIZE_ENCODED 过滤器去除或 URL 编码不需要的字符。

该过滤器与 urlencode() 函数很类似。

  • Name: "encoded"
  • ID-number: 514

可能的标志:

  • FILTER_FLAG_STRIP_LOW - 去除 ASCII 值在 32 以下的字符
  • FILTER_FLAG_STRIP_HIGH - 去除 ASCII 值在 32 以上的字符
  • FILTER_FLAG_ENCODE_LOW - 编码 ASCII 值在 32 以下的字符
  • FILTER_FLAG_ENCODE_HIGH - 编码 ASCII 值在 32 以上的字符

实例


<?php
$url="http://www.codercto.com";
var_dump(filter_var($url,FILTER_SANITIZE_ENCODED));
?>

代码的输出如下所示:


string(29) "http%3A%2F%2Fwww.codercto.com"


点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Design and Analysis of Distributed Algorithms (Wiley Series on P

Design and Analysis of Distributed Algorithms (Wiley Series on P

Nicola Santoro / Wiley-Interscience / 2006-10-27 / USD 140.95

This text is based on a simple and fully reactive computational model that allows for intuitive comprehension and logical designs. The principles and techniques presented can be applied to any distrib......一起来看看 《Design and Analysis of Distributed Algorithms (Wiley Series on P》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

MD5 加密
MD5 加密

MD5 加密工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具