redgunner Posted August 14, 2009 Share Posted August 14, 2009 $SMS->send('44123456789', 'SMS Alert Sent'); This is my above code which works fine, however I want it do the following; $SMS->send('44123456789, 'SMS Alert from $_REQUEST["emailaddress"]'); What do I need to do? Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/170246-request-variable/ Share on other sites More sharing options...
trq Posted August 14, 2009 Share Posted August 14, 2009 Variables are not interpolated within single quotes. $SMS->send('44123456789', 'SMS Alert from ' . $_REQUEST["emailaddress"]); Quote Link to comment https://forums.phpfreaks.com/topic/170246-request-variable/#findComment-898041 Share on other sites More sharing options...
RichardRotterdam Posted August 14, 2009 Share Posted August 14, 2009 Ah Thrope beat me to it but anyway. $SMS->send('44123456789, 'SMS Alert from $_REQUEST["emailaddress"]'); Since you are using single quotes the variable value wont be placed in the string. Using double quotes like the following will also work $SMS->send('44123456789, "SMS Alert from {$_REQUEST['emailaddress']}"); Quote Link to comment https://forums.phpfreaks.com/topic/170246-request-variable/#findComment-898043 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.