priyamp mp1 priyamp mp1 - 2 years ago 136
PHP Question

Yii preg match Not allowed Numbers only

How to avoid numbers only in Name Validation in php? I want to do Name Allowed space,dot,special character,string but not allowed Numbers only How?

Am using below code,

array('first_name,last_name', 'match', 'pattern' => '/^[A-Za-z0-9_]+$/u', 'message' => '{attribute} contain Alphabets only',),

It not allowed Special character too?

Answer Source
    echo 'you are not allowed to use numbers';

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download