This is my orginal url. now I want to change %username% instead of $username.
$username = "abcd";
This is my orginal url. now I want to change %username% instead of $username.
$username = "abcd";
Use the str_replace function.
$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);
Once you have the url, you can use str_replace() to put variables instead of certain strings.
$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%");