Location: PHPKode > projects > ObsceneClean > TESTSPC.PHP
<?php  
$TempArray = "";
echo '<BR>---------------go 0001----------------------------';
echo '<BR>-------------------------------------------';
echo '<BR> test for script  basic latin<BR>';
$subj = 'BAsicLatin' ;
$pattern1 = '/[\x{0000}-\x{007F}]*/iux';
echo '<BR>  $subj=';
var_dump($subj);
echo '<BR>  $pattern1=';
var_dump($pattern1);
if (preg_match_all($pattern1, $subj, $TempArray)> 0)
	{
	echo '<BR>  $TempArray=';
	var_dump($TempArray);
	}
else { echo 'NO match'; }
echo '<BR>-------------------------------------------';
$TempArray = "";
echo '<BR> test for  latin  extended B<BR>';
$subj = '   Ƃ ƃ' ;
$pattern1 = '/[\x{0180}-\x{024F}]/iux';
echo '<BR>  $subj=';
var_dump($subj);
echo '<BR>  $pattern1=';
var_dump($pattern1);
if (preg_match_all($pattern1, $subj, $TempArray)> 0)
	{
	echo '<BR>  $TempArray=';
	var_dump($TempArray);
	}
else { echo 'NO match'; }
echo '<BR>-------------------------------------------';
$TempArray = "";
echo '<BR> test for  latin  extended B again<BR>';
$subj = 'BAsicLatin' ;
$pattern1 = '/[\x{0180}-\x{024F}]/iux';
echo '<BR>  $subj=';
var_dump($subj);
echo '<BR>  $pattern1=';
var_dump($pattern1);
if (preg_match_all($pattern1, $subj, $TempArray)> 0)
	{
	echo '<BR>  $TempArray=';
	var_dump($TempArray);
	}
else { echo 'NO match'; }
echo '<BR>-------------------------------------------';
$TempArray = "";
echo '<BR> test for  CJK <BR>';
$subj = '齣鼼麻閃笝' ;
$pattern1 = '/[\x{4E00}-\x{9FA5}]/iux';
echo '<BR>  $subj=';
var_dump($subj);
echo '<BR>  $pattern1=';
var_dump($pattern1);
if (preg_match_all($pattern1, $subj, $TempArray)> 0)
	{
	echo '<BR>  $TempArray=';
	var_dump($TempArray);
	}
else { echo 'NO match'; }
echo '<BR>-------------------------------------------';
$TempArray = "";
echo '<BR> test for  CJK again <BR>';
$subj = 'you mama!' ;
$pattern1 = '/[\x{4E00}-\x{9FA5}]/iux';
echo '<BR>  $subj=';
var_dump($subj);
echo '<BR>  $pattern1=';
var_dump($pattern1);
if (preg_match_all($pattern1, $subj, $TempArray)> 0)
	{
	echo '<BR>  $TempArray=';
	var_dump($TempArray);
	}
else { echo 'NO match'; }
?>



Return current item: ObsceneClean