如何在簡單引號內使用變量($ _REQUEST('subject'))。 這是我的代碼:在簡單引號內插入變量PHP
<?php
$uri = 'https://mandrillapp.com/api/1.0/messages/send.json';
$postString = '{//i can't quit this quotation mark
"key": "myapi",
"message": {
"html": "this is the emails html content",
"subject": "$_REQUEST['subject'];",//this dont work
"from_email": "[email protected]",
"from_name": "John",
"to": [
{
"email": "[email protected]",
"name": "Bob"
}
],
"headers": {
},
"auto_text": true
},
"async": false
}';
?>
您還應該清理$ _REQUEST變量中的數據。 – ldg