if(!function_exists("mb_strlen1"))
{
function mb_strlen1($str,$enc='gb2312')
{
$l=0;
for($i=0; $i
if(ord($str[$i])>128)
{
if($enc=='gb2312')
{
$i++;
}
else if($enc=='utf8'||$enc=='utf-8')
{
$i+=2;
}
}
$l++;
}
return $l;
}
}
echo "/$l=".mb_strlen1("我市1ge中国人");
functionソケットData($host,$url,$headers='',$data){ $fp = @fsockopen( $host、80、$errno、$errstr、30); if (!$fp) { return false; } else { $out = ($data?"POST":"GET")." ".$url." HTTP/1.1rn"; $out .= "ホスト: ".$host."rn"; $out .= $headers; $out .= "接続: Closernrn".$data; fwrite($fp, $out); $rtn = ""; while (!feof($fp)) { $rtn.= fgets($fp, 128); fclose($fp); } //エコー $rtn; $rtn=explode("rnrn",$rtn,2); $headerstr=explode("rn",$rtn[0]); //echo print_r($headerstr,1).'->'.__LINE__."
echoソケットData(**.cn','/index.php',"Cookie: lstat_bc_644048=27325049701746404581; PHPSESSID=addf71fbaf5e1efd9520d1aea8a69b66/r/n")