PHP - Function ctype_lower()


Advertisements


Syntax

ctype_lower ( $text );

Definition and Usage

Thsi function checkes if all of the characters in the provided string, text, are lowercase letters.

Parameters

ParameterDescription
textRequired. The tested string.

Return Value

Returns TRUE if every character in text is a lowercase letter in the current locale.

Example

Try out following example:

<?php
$strings = array('aac123', 'testing', "testin IS Done");
foreach ($strings as $testcase) {
 if (ctype_lower($testcase)) {
     echo "$testcase consists of all lowercase letters. \n";
 } else {
     echo "$testcase does not have all lowercase letters. \n";
 }
}
?> 

This will produce following result:

aac123 does not have all lowercase letters.
testing consists of all lowercase letters.
testin IS Done does not have all lowercase letters.

php_function_reference.htm

Advertisements