I am trying to build some JSON on the in PHP. I am brand new to PHP and know very little about it. Currently, I have the following:
$json = '{"content":{"person":{"name":"$name", "email":"$email"}, "title":"$subject", "description": { "body": "$details" }}}';
$name, $email, $subject, and $details are all variables that have been defined previously. If I print out $json using the code above, I get the following:
{"content":{"person":{"name":"$name", "email":"$email"}, "title":"$subject", "description": { "body": "$details" }}}'
In other words, my variables didn't replace the placeholders in the string. How do I build some JSON using variables as key values?
Thank you!