String Question. How to count the number of A,a, numeric and special char

Posted by Brad on Stack Overflow See other posts from Stack Overflow or by Brad
Published on 2010-04-04T01:23:14Z Indexed on 2010/04/04 1:33 UTC
Read the original article Hit count: 367

Filed under:

I have randomly created strings such as

H*P2[-%-3:5RW0j*;k52vedsSQ5{)ROkb]P/*DZTr*-UX4sp

What I want to do is get a count of all Caps, lower case, numeric and special characters in each string as they are generated.

I am looking for an output similar to Caps = 5 Lower = 3 numneric = 6 Special = 4 Fictitious values of course. I have gone through the php string pages using count_char, substr_count etc but cant find what I am looking for.

Thank you

© Stack Overflow or respective owner

Related posts about php