博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ctype函数_PHP ctype_cntrl()函数与示例
阅读量:2529 次
发布时间:2019-05-11

本文共 1568 字,大约阅读时间需要 5 分钟。

ctype函数

PHP ctype_cntrl()函数 (PHP ctype_cntrl() function)

ctype_cntrl() function is a character type (CType) function in PHP, it is used to check whether a given string contains all control characters or not.

ctype_cntrl()函数是PHP中的字符类型(CType)函数,用于检查给定的字符串是否包含所有控制字符。

It returns true if all characters of the given strings are control characters (like, a newline character, tab character, escape character etc). Else it returns false.

如果给定字符串的所有字符都是控制字符(例如,换行符,制表符,转义符等),则返回true 。 否则返回false 。

Note: Though control characters are unprintable character i.e. they cannot be represented in the string format if we represent they may display like symbols. So, we can provide the escape sequences in the string by following with forwarding slash (\), we can also provide the control character’s ASCII code in the range of hexadecimal values from 0x00 to 0x1f and 0x7f (Del).

注意:尽管控制字符是不可打印的字符,即如果我们表示它们可能显示为类似符号,则它们不能以字符串格式表示。 因此,我们可以在字符串后加上正斜杠( \ )来提供转义序列,还可以提供控制字符的ASCII代码,范围为从0x00到0x1f和0x7f (Del)的十六进制值。

To assign characters to value ASCII format (hexadecimal value), we use \x with the value.

要将字符分配给值ASCII格式(十六进制值),我们使用\ x作为值。

Syntax:

句法:

ctype_cntrl(string) : bool

Example:

例:

Input: "\r\n"    Output: true    Input: "\t\x12"    Output: true    Input: "\x00\x12\x1f\x7f"    Output: true    Input: "Hello123"    Output: false

PHP code:

PHP代码:

Output

输出量

str1 contains all control characters.str2 contains all control characters.str3 contains all control characters.str4 does not contain all control characters.str5 does not contain all control characters.

翻译自:

ctype函数

转载地址:http://wuxzd.baihongyu.com/

你可能感兴趣的文章
feign调用spring clound eureka 注册中心服务
查看>>
ZT:Linux上安装JDK,最准确
查看>>
LimeJS指南3
查看>>
关于C++ const成员的一些细节
查看>>
《代码大全》学习摘要(五)软件构建中的设计(下)
查看>>
C#检测驱动是否安装的问题
查看>>
web-4. 装饰页面的图像
查看>>
微信测试账户
查看>>
Android ListView上拉获取下一页
查看>>
算法练习题
查看>>
学习使用Django一 安装虚拟环境
查看>>
Hibernate视频学习笔记(8)Lazy策略
查看>>
CSS3 结构性伪类选择器(1)
查看>>
IOS 杂笔-14(被人遗忘的owner)
查看>>
自动测试用工具
查看>>
前端基础之BOM和DOM
查看>>
[T-ARA/筷子兄弟][Little Apple]
查看>>
编译Libgdiplus遇到的问题
查看>>
【NOIP 模拟赛】Evensgn 剪树枝 树形dp
查看>>
java学习笔记④MySql数据库--01/02 database table 数据的增删改
查看>>