2016-02-05 65 views
1
'&message=Hi Your 6 digit OTP code is :-'.$otp_code.' 

大家好,我有我傳遞上面的字符串作爲消息中的查詢字符串的消息有問題不從SMS網關收到全長短信,收到短信跳過空格後的字符串

給定URL通過短信網關公司是

http://sms.w3karigar.com/http-api.php?username=enterusername&password=enterpassword&senderid=6char-senderid&route=1&number=enternumber&message=Hi Your 6 digit OTP code is :-'.$otp_code.' 

收到消息只包含嗨。

當我通過查詢字符串像

-

http://sms.w3karigar.com/http-api.php?username=enterusername&password=enterpassword&senderid=6char-senderid&route=1&number=enternumber&message=HiYour6digitOTPcodeis'.$otp_code.' 

然後我接到全長短信。 任何人都可以幫助我謝謝!

回答

3

使用php功能urlencode()創建URL

urlencode ("Hi Your 6 digit OTP code is :-".$otp_code) 
+0

謝謝哥們它工作得很好。 –

+0

非常好接受我的回答 –

+0

是的,但目前我沒有足夠的聲望。 –

0

正則表達式應該能夠幫助你

$url = $_SERVER['REDIRECT_URL']; 
 
preg_match('/message=(.*?)($|&)/is', $url, $message); 
 
var_dump($message[1]);EXIT;


通常我們編碼請求的網址,我們使用它之前:

Hi Your 6 digit OTP code is :-'.$otp_code.'

Hi%20Your%206%20digit%20OTP%20code%20is%20:-%27.$otp_code.%27