hey, i'm having a bit of trouble trying to find a function that can validate non-ASCII characters in PhP on a form (accents,é,Ã,ó,ú,ã,etc). Please help me, i'm lost!
I was waiting for someone to post, I'm not so sure about support for non-standard letters nor do I have any on my board, however aswell as chr, ord might be useful as it returns the asci value, possibly if ord can convert it to an asci digit then chr should be able to turn it back, and so you can loop through and validate the form input.....
thx, tried the chr() for instance <pre> <?php foreach (range(1, 255) as $num) { $char = chr($num); $result = preg_match('/[^\x0-\x7F]/', $char); printf('%2d = %s => %d<br>', $num, $char, $result); } ?> </pre> seems ok?
well I get quite a lotta squares from that code, but can see the ones with accents on also, so be a bit more specific about how you want to validate the data, and we'll go from there ....