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

 

词条 ctype_space
释义

ctype_space

(PHP 4 >= 4.0.4, PHP 5)

ctype_space -- Check for whitespace character(s)

说明

bool ctype_space ( string text )

Checks if all of the characters in the provided string, text, creates whitespace.

参数

text The tested string.

返回值

Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters.

范例

A ctype_space()example
<?php
$strings = array('string1' => "\\\r\\t", 'string2' => "\arf12", 'string3' => '\\\r\\t');
foreach ($strings as $name => $testcase) {
if (ctype_space($testcase)) {
echo "The string '$name' consists of all whitespace characters.\";
} else {
echo "The string '$name' does not consist of all whitespace characters.\";
}
}
?> 上例将输出:
The string 'string1' consists of all whitespace characters. The string 'string2' does not consist of all whitespace characters. The string 'string3' does not consist of all whitespace characters.

随便看

 

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

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2024/12/24 21:58:53