Re: Check if string is pure ASCII?
| From: | Eric Butera | Date: | Mon, 20 Nov 2006 17:30:18 +0000 |
| Subject: | Re: Check if string is pure ASCII? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-244889@lists.php.net to get a copy of this message | ||
On 11/20/06, Jens Meyer <jm@jensmeyer.de> wrote:
Hello all! To add special string-conversions for an imap-client only for strings with special chars I am looking for a function which checks if a string consists only standard ascii-chars. I "see"/googled the following solutions: - check for special chars (i.e. German umlauts) with preg_match() With this solution all other international charsets are not recognized. Not the best solution... - check if string contains only letters and some chars with preg_match() In this case I must add all standard ASCII-chars to regexp. Would be possible. - standard-function? Is there any php-function for this available which I haven't found until now? Thank you for your hints and kind regards,I've never tried it before but maybe a combination of setlocale() and ctype_alnum() might do the trick?Jens-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php