-
回首忆惘然
使用 str_replace 函数。$url = "https://connectsms.vodafone.com.qa/SMSConnect/SendServlet?application=%username%&password=%password%&content=%message_text%&destination=%gsm%&source=%shortcode%&mask=%mask%";//define variables$username = "abcd";//then$before = ["%username%","%password%"];$after = [$username,$password];$output = str_replace($before,$after,$url);
-
拉莫斯之舞
获得 url 后,您可以使用 str_replace() 来放置变量而不是某些字符串。$new_url = str_replace("%username%" , $username, "http://"."https://connectsms.vodafone.com.qa/SMSConnect/SendServlet?application=%username%&password=%password%&content=%message_text%&destination=%gsm%&source=%shortcode%&mask=%mask%");https://www.php.net/manual/en/function.str-replace.php
-
Qyouu
只需替换%username%而不是<?php echo $username ?> https://connectsms.vodafone.com.qa/SMSConnect/SendServlet?application=<?php echo $username ?>&password=%password%&content=%message_text%&destination=%gsm%&source=%shortcode%&mask=%mask%