求大神帮忙解决一下这个PHP难题

求大神帮忙解决一下这个问题。非常感谢!

就是用PHP实现提取这个页面(http://www.pder.org/f.php)里面每个uin后面的数字,那个数字就是QQ号,并且列出来使用到新的连接进去。

比如把那个数字使用到这个连接里面 http://q.qlogo.cn/headimg_dl?bs=qq&dst_uin=这里就是QQ号&src_uin=SW&fid=blog&spec=100

并且排列出来。

求大神解决,谢谢,万分感谢!

<?php
header("Content-type:text/html;charset=utf-8");
function get(){
$url="http://www.pder.org/f.php";
$ch=curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$string=curl_exec($ch);

curl_close($ch);
return $string;

}
function parse($string){
while(true){
if(strpos($string, "
")>0){
$count=strpos($string, "
");
$kk=substr_replace($string, "", $count,4);
$string=$kk;
//echo $kk."
";
}else{
break;
}
}
$string=substr($string, 10,-2);
return $string;
//print_r($arr);
}
$string=get();
$string=parse($string);
$string=iconv("gbk", "utf-8", $string);
$arr=json_decode($string,true);

$newarr=array();
foreach($arr['data']['item'] as $key => $value){
$newarr[]=$value['uin'];
}
print_r($newarr);

写得有点乱,只是获取出所有qq号了

$content = file_get_contents("http://www.pder.org/f.php");
$content = iconv('gbk', 'utf-8', $content);
$start = strpos($content,'[');
$end = strpos($content,']')+1;
$length = $end - $start;
$content = substr($content, $start, $length);
$arr = json_decode($content,true);
for($i = 0;$i < count($arr);$i++)
echo $arr[$i]['uin'].'
';

这应该是jsonp返回的数据,但是它返回的数据不是正确的json格式,里面包含了'
',如果能去掉就能直接用JQuery获取到:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test-Jsonp</title>
</head>

<body>

<script type="text/javascript" src="js/jquery172p.js"></script>  
<script type="text/javascript">  
jQuery(document).ready(function(){   

var baseUrl = "http://q.qlogo.cn/headimg_dl?bs=qq&src_uin=SW&fid=blog&spec=100&dst_uin=";
var newUrlArr = new Array();
$.ajax({  
     type: "get",  
     async: false,  
     url: "http://www.pder.org/f.php",  
     dataType: "jsonp",  
     //jsonp: "callback",//传递给请求处理程序或页面的,用以获得jsonp回调函数名的参数名(一般默认为:callback)  
     jsonpCallback:"_Callback",//自定义的jsonp回调函数名称,默认为jQuery自动生成的随机函数名,也可以写"?",jQuery会自动为你处理数据  
     success: function(json){
         data = json.data.item;
         for (i=0; i<data.length; i++){
             var obj = data[i];
             var newUrl = baseUrl + obj.uin;
             newUrlArr[i] = newUrl;  //新地址
         }
         document.write(newUrlArr.join('<br/>'));  
     },  
     error: function(){  
         alert('fail');  
     }

 });  
});  
</script>  

</body>
</html>