Maison  >  Article  >  développement back-end  >  求指导简化~解决办法

求指导简化~解决办法

WBOY
WBOYoriginal
2016-06-13 10:11:14709parcourir

求指导简化~

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';%24content=str_substr(%24str%20,%20%24start,%20%24end);%20echo%20%24content;%20function%20str_substr(%24str%20,%24start,%20%24end)%20%7B%20%20%20%20%20%24x%20=%20strpos(%24str,%20%24start);%20%20%20%20%20%24y%20=%20strpos(%24str,%20%24end);%20%20%20%20%24getstr=%20substr(%24str,%24x+strlen(%24start),%24y-%24x);%20%20%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/';preg_match(%24pattern,%24str,%24match);print_r(%24match%5B1%5D);<div%20class=" clear alt="求指导简化~解决办法" >
                 
              
              
        
            </span>
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Article précédent:php-无头冤尸.该怎么解决Article suivant: 这个是什么东东