Computer >> Computer tutorials >  >> Programming >> PHP

ctype_lower() function in PHP


The ctype_lower() function check for lowercase character(s). It returns TRUE if every character in text is a lowercase letter in the current locale.

Syntax

ctype_lower(str)

Parameters

  • str − The tested string

Return

The ctype_lower() function returns TRUE if every character in text is a lowercase letter in the current locale.

Example

The following is an example −

<?php
$arr = array('Tim879', 'tom');

   foreach ($arr as $x) {
      if (ctype_lower($x)) {
         echo "$x consists of all lowercase letters. \n";
      }else {
         echo "$x does not have all lowercase letters. \n";
      }
   }
?>

Output

The following is the output −

Tim879 does not have all lowercase letters.
tom consists of all lowercase letters.