php 检查字符串是否只包含字母

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 检查字符串是否只包含字母相关的知识,希望对你有一定的参考价值。

<?php
if ( ctype_alpha( $input ) ) {
    echo $input . ' only contains letters.';
} else {
    echo $input . ' does not only contains letters.';
}

以上是关于php 检查字符串是否只包含字母的主要内容,如果未能解决你的问题,请参考以下文章