Home  >  Article  >  Backend Development  >  PHP 远程调用有关问题!望高手帮忙教下如何做

PHP 远程调用有关问题!望高手帮忙教下如何做

WBOY
WBOYOriginal
2016-06-13 12:10:30905browse

PHP 远程调用问题!望高手帮忙教下怎么做!
以下是我自己弄的!
建立个 123.php文件 如下

$url = "http://www.123456.com/Ajax.ashx?Action=AddOrder&OrderIDShow=1&id=10086&Amt=10&Mb=2&[email&#160;protected]";  <br />$result = file_get_contents($url);   <br />echo $result;<br />

显示出的结果是   YES_5e286f3e

可是我想把 YES_去掉  单单显示出  5e286f3e  请问我需要怎么做! 本人小菜一个,望高手能帮忙解答!
------解决思路----------------------
<br />$str = "YES_5e286f3e";<br />$arr = explode('_',$str);<br />echo $arr[1];<br />

------解决思路----------------------
$url = "http://www.123456.com/Ajax.ashx?Action=AddOrder&OrderIDShow=1&id=10086&Amt=10&Mb=2&[email protected]";  
$result =explode('_',file_get_contents($url));
echo $result[1];
------解决思路----------------------
<br />$result = ltrim('YES_5e286f3e','YES_');<br />echo $result;<br />

------解决思路----------------------
這樣就可以了。
<br />$url = "http://www.123456.com/Ajax.ashx?Action=AddOrder&OrderIDShow=1&id=10086&Amt=10&Mb=2&[email&#160;protected]";  <br />$result = file_get_contents($url);   <br />$result = str_replace('YES_', '', $result); // 把YES_替換為空<br />echo $result;<br />

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn