Have been playing around a bit with this code, but I can't get it to work with international characters… For example, if I feed my function:
function split_bokid($bokid)
{
if (preg_match('/^([a-zåäö]{2,3})([0-9]{4,5}(\-[0-9]{1,2}){0,1})$/ i',$bokid,$m='')) {
return $m;
}
else
{
return false;
}
}
returns, with the following code:
$test = split_bokid("ääö123");
I assume you mean:
$test = split_bokid("ääö12345");
echo $test[1]; echo $test[2];
the values: ŠŠš 12345
So, is there any way I can set the encoding on the incoming values, which will come from url's and databases, so that they don't fuck up?
I don't know. It works fine on my computer. The letters display correctly on the command line and even in Mozilla.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php