forked from kerphi/phpfreechat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathctype.php
47 lines (38 loc) · 1.07 KB
/
ctype.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
//
// TO RUN THIS TESTCASE : PREFIX THE FUNCTIONS NAMES BY my_ IN lib/ctype/ctype.php
//
require_once dirname(__FILE__).'/../lib/ctype/ctype.php';
// examples for verifying
$test[] = "";
$test[] = "\t";
$test[] = "\r";
$test[] = "\n";
$test[] = " ";
$test[] = "\n-";
$test[] = " x";
$test[] = "12 3";
$test[] = ". abc";
$test[] = "abc";
$test[] = "AzEdFDe";
$test[] = "ABC9";
$test[] = "aBcF4";
$test[] = "0123456789ABCDEFabcdef";
$test[] = "034DEFa5612789ABCbcdef";
$test[] = "012djgfbbku3456789ABCDEFabcdef";
echo "ctype_space()"."<br />";
foreach ($test as $a)
{
echo $a . " : " . ((my_ctype_space($a)) ? "true" : "false") ." : " . ((ctype_space($a)) ? "true" : "false") ."<br />";
}
echo "ctype_xdigit()"."<br />";
foreach ($test as $a)
{
echo $a . " : " . ((my_ctype_xdigit($a)) ? "true" : "false"). " : " . ((ctype_xdigit($a)) ? "true" : "false") ."<br />";
}
echo "ctype_alpha()"."<br />";
foreach ($test as $a)
{
echo $a . " : " . ((my_ctype_alpha($a)) ? "true" : "false") ." : " . ((ctype_alpha($a)) ? "true" : "false") ."<br />";
}
?>