PHP Remote Call Problem! Look at the master to help teach how to do!

Source: Internet
Author: User
Here's my own!
Create a 123.php file as follows

$url = "Http://www.123456.com/Ajax.ashx?" Action=addorder&orderidshow=1&id=10086&amt=10&mb=2&email=fdhfdf@qq.com ";  $result = file_get_contents ($url);   echo $result;

The results shown are yes_5e286f3e

But I want to get rid of Yes_ just show 5e286f3e ask what I need to do! I am a piece of cake, looking for a master can help answer!


Reply to discussion (solution)

You go to the end of the results if you just want to get rid of yes_ then you can use regular or cut according to _ to cut the back of the good.

$str = "yes_5e286f3e"; $arr = Explode (' _ ', $str); echo $arr [1];

$url = "Http://www.123456.com/Ajax.ashx?" Action=addorder&orderidshow=1&id=10086&amt=10&mb=2&email=fdhfdf@qq.com ";
$result =explode (' _ ', file_get_contents ($url));
echo $result [1];

$result = LTrim (' yes_5e286f3e ', ' Yes_ '); Echo $result;

?? You can do it.

$url = "Http://www.123456.com/Ajax.ashx?" Action=addorder&orderidshow=1&id=10086&amt=10&mb=2&email=fdhfdf@qq.com ";  $result = file_get_contents ($url);   $result = Str_replace (' Yes_ ', ' ', $result); To replace the Yes_? Empty echo $result;

Replace ' Yes_ ' with empty.
Reference function: Str_replace ();

Although I have found a solution, but thank you!

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.