ctype_graph ( $text );
此函数检查提供的字符串text中的所有字符是否创建可见输出。
Sr.No | Parameter & Description |
---|---|
1 |
text(必需) 匹配字符串。 |
如果文本中的每个字符都是可打印的,并且实际创建了可见输出(没有空格),则返回true,否则返回false。
<?php $strings=array('asdf\n\r\t', 'arf12', 'LKA#@%.54'); foreach ($strings as $test) { if (ctype_graph($test)) { echo "$test consists of all (visibly) printable characters\n"; }else { echo "$test does not have all (visibly) printable characters.\n"; } } ?>
这将产生以下输出-
asdf\n\r\t consists of all (visibly) printable characters. arf12 consists of all (visibly) printable characters LKA#@%.54 consists of all (visibly) printable characters
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)