词条 | 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条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。