请输入您要查询的百科知识:

 

词条 ctype_punct
释义

ctype_punct

(PHP 4 >= 4.0.4, PHP 5)

ctype_punct -- 检查是否有任何可打印字符而不是空格或字母数字字符

函数原型

bool ctype_punct ( string text )

检查是否有任何可打印字符而不是空格或字母数字字符

范例

<?php

$strings = array('ABasdk!@!$#', '!@ # $', '*&$()');

foreach ($strings as $testcase) {

if (ctype_punct($testcase)) {

echo "The string $testcase consists of all punctuation.\";

} else {

echo "The string $testcase does not consist of all punctuation.\";

}

}

?>

上例将输出:

The string ABasdk!@!$# does not consist of all punctuation. The string !@ # $ does not consist of all punctuation. The string *&$() consists of all punctuation.

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2024/11/15 20:25:15