English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP ctype_lower() Function Usage and Example

PHP Ctype Function Manual

The ctype_lower() function checks if all characters in the string are lowercase letters.

Syntax

ctype_lower ( $text );

Definition and Usage

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

Parameter

NumberParameters and Description
1

text(Required)

The string to be tested.

Return Value

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

Online Example

Check if all characters are lowercase letters.

<?php
   $strings = array('aac123', 'testing', "testin IS Done");
   
   foreach ($strings as $test) {
      if (ctype_lower($test)) {
         echo "$test All lowercase letters. \n";
      }else {
         echo "$test Contains characters that are not lowercase letters or characters. \n";
      }
   }
?>
Test and see‹/›

Output Result:

aac123 Contains characters that are not lowercase letters or characters.
testing All lowercase letters.
testin IS Done contains characters that are not lowercase letters or characters.

   PHP Ctype Function Manual