คำอธิบาย
ฟังก์ชัน ctype_lower() ตรวจสอบว่าตัวอักษรทุกตัวในสตริงเป็นตัวพิมพ์เล็ก (lowercase) ทั้งหมดหรือไม่
รูปแบบการใช้งาน (Syntax)
ctype_lower(str)
พารามิเตอร์
- str — สตริงที่ต้องการตรวจสอบ
ค่าที่คืนกลับ
คืนค่า TRUE หากทุกตัวอักษรเป็นตัวพิมพ์เล็ก หรือ FALSE หากไม่ใช่
ตัวอย่างการใช้งาน
<?php
$arr = array('hello', 'Hello', 'thailand', 'abc123');
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";
}
}
?>
ผลลัพธ์
hello consists of all lowercase letters. Hello does not have all lowercase letters. thailand consists of all lowercase letters. abc123 does not have all lowercase letters.