note 30564 modified in function.chr by vrana

From: Date: Tue, 17 Aug 2004 14:54:47 +0000
Subject: note 30564 modified in function.chr by vrana
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-79727@lists.php.net to get a copy of this message
I usally used this code to test a Chinese string: <?php $chinese_str = "³Â²®ÀÖ"; if (preg_match("/^[".chr(0xa1)."-".chr(0xff)."_-]+$/",$chinese_str) { echo 'This is a Chinese word..'; } else { echo 'This is not a Chinese word..'; } ?> --was-- I usally used this code to test a Chinese string: $chinese_str = "³Â²®ÀÖ"; if (preg_match("/^[".chr(0xa1)."-".chr(0xff)."_-]+$/",$chinese_str) { echo 'This is a Chinese word..'; } else { echo 'This is not a Chinese word..'; } http://php.net/manual/en/function.chr.php

« previous php.notes (#79727) next »