• PHP Video Tutorials

PHP - Function ctype_lower()



Syntax

ctype_lower ( $text );

Definition and Usage

This function checks if all of the characters in the provided string, text, are lowercase letters.

Parameters

Sr.No Parameter & Description
1

text(Required)

The tested string.

Return Value

It 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 $test) {
      if (ctype_lower($test)) {
         echo "$test consists of all lowercase letters. \n";
      }else {
         echo "$test does not have all lowercase letters. \n";
      }
   }
?> 

This will produce the 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