cags Posted December 16, 2009 Share Posted December 16, 2009 This isn't exactly a Regular Expressions question, but since it's in relation to a pattern and I couldn't think of anywhere better to put it, it's going in the Regular Expressions section. The PHP manual defines valid user-defined function names as being... [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* Ok, fair enough, but what characters are \x7f-\xff? As far as my knowledge stretches \x is an escape character followed by a hex code of some kind. But they aren't any valid ASCII characters that I know of, so what encoding is it? I never did fully understand character encodings. Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 16, 2009 Share Posted December 16, 2009 I think that is ASCII 127 to 255 I think not too sure, but from what I understand this could be for special character in other languages which use different keyboards, however I am not to sure about this and could be completely wrong Quote Link to comment Share on other sites More sharing options...
thebadbad Posted December 16, 2009 Share Posted December 16, 2009 rajiv is right, you can check the range in the last table on this page: http://www.ascii-code.com/ Edit: And you can output the range using range(): <?php print_r(range("\x7f", "\xff")); ?> Quote Link to comment Share on other sites More sharing options...
cags Posted December 16, 2009 Author Share Posted December 16, 2009 If that is the case, that doesn't make a whole deal of sense (to me at least). Since \x7f-\xff indicates all characters in that range, 7f is DELETE,   is also included in that range. I can perhaps understand some of the foreign characters being accepted but there are a lot of characters in that range that I really wouldn't expect to be valid. Having said that, I tested a few at random such as ¶ and they do appear to be valid. Quote Link to comment Share on other sites More sharing options...
salathe Posted December 16, 2009 Share Posted December 16, 2009 Just for reference, the hex escape sequence for double quoted strings is mentioned in the manual in the strings section: http://php.net/types.string Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.