>  기사  >  백엔드 개발  >  求指导简化~解决办法

求指导简化~解决办法

WBOY
WBOY원래의
2016-06-13 13:38:43825검색

求指导简化~

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
<?php //调用格式:localhost/getpro.php?userid=slowstang95///
$userid=$_GET["userid"];
$url="http://feedback.ebay.com/ws/eBayISAPI.dll?ViewFeedback2&userid=".$userid;
$str=file_get_contents($url);

$start='</span> <span class="mbg-l"> ( ';
$end='<img  src="http://q.ebaystatic';%0A%24content=str_substr(%24str%20,%20%24start,%20%24end);%20%0Aecho%20%24content;%20%0A%0Afunction%20str_substr(%24str%20,%24start,%20%24end)%20%7B%20%0A%20%20%20%20%24x%20=%20strpos(%24str,%20%24start);%20%0A%20%20%20%20%24y%20=%20strpos(%24str,%20%24end);%0A%20%20%20%20%24getstr=%20substr(%24str,%24x+strlen(%24start),%24y-%24x);%20%20%0A%20%20%20%20%24getstr2=str_replace('<img%20src=" http: return alt=" 求指导简化~解决办法 " >

</span>


------解决方案--------------------
PHP code
$userid=$_GET["userid"];
$url="http://feedback.ebay.com/ws/eBayISAPI.dll?ViewFeedback2&userid=".$userid;
$str=file_get_contents($url);
$pattern='/<span class="mbg-l">\s*\((.*?)<img  src="http:%5C/%5C/q%5C.ebaystatic%5C.com%5C/a/';%0Apreg_match(%24pattern,%24str,%24match);%0Aprint_r(%24match%5B1%5D);%20<div%20class=" clear alt=" 求指导简化~解决办法 " >
                 
              
              
        
            </span>
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.