note 27735 deleted from function.is-string by didou

From: Date: Wed, 29 Oct 2003 21:33:51 +0000
Subject: note 27735 deleted from function.is-string by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-59499@lists.php.net to get a copy of this message
Note Submitter: mwwaygoo @ hotmail dot com ---- don't re-invent the wheel guys. Your function for testing a single character can be done easier and better using ereg. return ereg("[[:alpha:]]",$character); QUOTE from ereg comments-name not given: Using: setlocale('LC_CTYPE', 'fr'), or setlocale('LC_ALL', 'fr') will enable the '[[:alpha:]]', '[[:upper:]]', and '[[:lower:]]' regexps, for ereg(), eregi(), preg() and pregi() functions, to match French letters (including [àâäçéèêëîïôöùûüÿ] and their uppercase versions). ---------------- The other code from Slicky was a little difficult to decifer, but I think I get the gist of it. You should be testing for isset and then is_string. is_string($key[1000]) alone gives false readings because the array is not that big. BUT isset($key[1000]) before is_string would give accurate readings P.S. I can't see any practical use for your code sample.

« previous php.notes (#59499) next »