<?php$a = '我是谁呢?';$b = '还有a个人';$t = '还我A人有';class sub_ord{ private $d;//要截取的字符串 private $long;//要截取字符串的长度 function __construct () { } function __destruct() { } function sub_org($d,$long) { for($i=0;$i<$long;$i++) { if(ord(substr($d,0,$i+1))>126) { $n++; } } if($n%2) { return $used = substr($d,0,$long-1); } else { return $used = substr($d,0,$long); } } }$test = new sub_ord();echo $test->sub_org($a,8);echo $prit = sub_ord::sub_org($a,8);?>