note 27735 added to function.is-string

From: Date: Tue, 17 Dec 2002 11:04:10 +0000
Subject: note 27735 added to function.is-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-41007@lists.php.net to get a copy of this message
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. -- http://www.php.net/manual/en/function.is-string.php http://master.php.net/manage/user-notes.php?action=edit+27735 http://master.php.net/manage/user-notes.php?action=delete+27735 http://master.php.net/manage/user-notes.php?action=reject+27735

« previous php.notes (#41007) next »