21,887
社区成员
发帖
与我相关
我的任务
分享
<?php
$fn = 'pyi.txt';
if(! file_exists($fn)) {
$url = 'http://blog.csdn.net/xuzuning/article/details/5611291';
$s = file_get_contents($url);
preg_match('#CODE<br />(.+)<br />CODE#is', $s, $r);
$s = str_replace('&nb'.'sp;', ' ', $r[1]);
file_put_contents($fn, $s);
}
$s = file_get_contents($fn);
for($i=0; $i<strlen($s); $i++) {
if($s{$i} == ' ') continue;
$h = floor($i / 0xbf) + 0x81;
$l = ($i % 0xbf) + 0x40;
// echo chr($h) . chr($l) . $s{$i};
$HZ = chr($h) . chr($l);
$zimu = $s{$i};
echo "INSERT INTO `piying5` (`HZ`, `zimu`) VALUES ('$HZ', '$zimu');<br/>";
}
?>