Encapsulate an SMS interface today. The company staff accessed the interface I wrote. after verifying my identity, I transferred the real SMS interface in the program to achieve the channel control function. Today, an SMS interface is encapsulated. The company staff accessed the interface I wrote. after verifying my identity, I adjusted the real SMS interface in the program to implement the channel control function.
Call the real SMS interface to form a URL consisting of the user name, password, target mobile phone number, and text message content. use file_get_contents () to remotely access it. I did not expect such a simple function to make me feel ashamed for one afternoon.
Now let's talk about the problem. when I access the file_get_contents interface URL, I will only use half of the text message content I receive. No problems were found. Copy the website to the address bar of the browser and receive the complete text message. Tried CURL, file_get_contents, and fopen.
I don't know when to change the browser. when I lose, a 505 error is reported. Finally, I had some tips, so I had to search online. Finally, I found the answer.
If you want to open a URL with special characters (such as spaces), you need to use urlencode () for URL encoding. Remember to encode Chinese characters before using them.
The previous browsers have helped you automatically transcode your code, so no problems have been found.
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