Skip to content

Instantly share code, notes, and snippets.

@taichunmin
Created June 4, 2014 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taichunmin/5dd017948fdbf495ab83 to your computer and use it in GitHub Desktop.
Save taichunmin/5dd017948fdbf495ab83 to your computer and use it in GitHub Desktop.
<?php
// function tai_checkZHTW($str)
// {
// return preg_match('/(\xe2[\xba-\xbf][\x80-\xbf]|[\xe3-\xe9][\x80-\xbf]{2})/',$str);
// }
public function is_Han( $str )
{
return preg_match("/\p{Han}+/u", $str);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment