I want to detect if a string contains both numbers and letters.
For example:
- Given
PncC1KECj4pPVW, it would be written to a text file because it contains both. - Given
qdEQ, it would not, because it only contains letters.
Is there a method to do this?
I was trying to use
$string = PREG_REPLACE("/[^0-9a-zA-Z]/i", '', $buffer);
But it didn’t work.
Any help would be appreciated.
Answer updated based on https://stackoverflow.com/a/9336130/315550, thnx to https://stackoverflow.com/users/116286/jb