我是supesite7 utf8版的,写成如下这样,调试的时候,就没有乱码了,也可以解决调试正常一采集就结束的问题,哈哈- function geturlfile($url, $encode=1) {
- global $thevalue, $_SCONFIG;
- $text = '';
- if(!empty($url)) {
- if(function_exists('file_get_contents')) {
- @$text = file_get_contents($url);
- } else {
- @$carr = file($url);
- if(!empty($carr) && is_array($carr)) {
- $text = implode('',$carr);
- }
- }
- }
- $text = str_replace('·', '', $text);
- if(!empty($thevalue['encode']) && ($encode == 1) && function_exists('iconv')) {
- $text = iconv($thevalue['encode'], $_SCONFIG['charset'].'//IGNORE', $text);
- } else {
- $text = encodeconvert($thevalue['encode'], $text);
- }
- return $text;
- }
复制代码 |