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! 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"]); 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']}"); Link to comment https://forums.phpfreaks.com/topic/170246-request-variable/#findComment-898043 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.