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

WBOY
Release: 2016-06-13 12:10:30
Original
904 people have browsed it

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 />
Copy after login

显示出的结果是 YES_5e286f3e

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

------解决思路----------------------
$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 />
Copy after login

------解决思路----------------------
這樣就可以了。
<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 />
Copy after login

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template