SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Pandora Tipem's Avatar
    Join Date
    Feb 2006
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Allowing Slavic Latin characters

    Hi,

    I have a function that checks to see if a string is an alphanumerical word character.

    Code php:
    // allows a-z, A-Z, 0-9, _, and -
     
    function wordchar($str)
    {
    	return (strspn($str, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-') == strlen($str));
    }
    However, when something such as "" is passed through this function, it's accepted as an alphanumerical word character, even though it's not in the list of allowed characters.

    Why is this? How can I fix this?
    Tipem no fancy sig, yup
    Need Neopets Help? Try Neopets
    fun adoptable eggs

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you sure that character is really an "Ä" at the time it's passed to that function? I'm thinking it's converted to something else.
    Are you using mbstring.func_overload?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •